Brackets inside a markdown link disable formatting

Whenever I have a link like

[*[a thing]* and *another*](example.com)

it gets rendered as *[a thing]* and another by Hugo (note the two asterisks around brackets that don’t turn into italics).

It seems the brackets disable markdown formatting inside links, even though *[a thing]* is rendered as [a thing] as one would expect.

I’ve tried to disable my link render hook with no results. In link render hook, .Text is already rendered, and, in that case, already got the problem.

this looks like a incomplete in common mark implementation (if I understood the spec right) with goldmark which Hugo uses (see below)

you may escape the square brackets in Hugo as a workaround

[*\[a thing\]* and *another*](example.com)   <-- renders fine

[*[a thing]* and *another*](example.com)

The Goldmark Playground renders that as you mention.

also not backed by an exact example in the Common Mark Spec their playground renders as you expect

1 Like

See:

This was fixed in Hugo v0.128.0.

2 Likes

Thank you very much, @jmooring for opening the issues, and @irkode for investigating it!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.