Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emphasis within links in Doxygen's Markdown

I can't seem to make an italic (ie. *emphasised*) link. I've tried the following syntaxes:

*[text](url)*
[*text*](url)
*[text]*(url)
[*emphasised* text](url)

According to the Doxygen manual:

a * or _ only starts an emphasis if

  • it is followed by an alphanumerical character, and
  • it is preceded by a space, newline, or one the following characters <{([,:;

An emphasis ends if

  • it is not followed by an alphanumerical character, and
  • it is not preceded by a space, newline, or one the following characters ({[<=+-\@

By this definition, this should work: [*text*](url), as the * is followed by an alphanumeric character, and preceded by a [ character. It should also end in the proper place, as ] is not an alphanumeric character, and the letter preceding it is alphanumeric.

Unfortunately, my HTML output instead preserves the * characters, leaving me with a link that looks like this: *link text*. Is this a bug, or am I not doing it right?

like image 976
Eric Dand Avatar asked Dec 05 '25 04:12

Eric Dand


1 Answers

As the Babelmark tool demonstrates, all but one of your examples works just fine in most Markdown parses. This appears to be a bug in the Markdown parser you are using. You might consider reporting it to the developers of that project.

Note that the one example you provided which does not work is this one:

*[text]*(url)

That example should never work as the rules state the following (emphasis added):

To create an inline link, use a set of regular parentheses immediately after the link text’s closing square bracket.

That means not even a space should be allowed between the parts of the link, although some implementations do allow a single space. Certainly no other characters should be allowed.

However, each item can contain other nested items. For that reason, all of the following are correct:

*[text](url)*
[*text*](url)
[*emphasised* text](url)

It is possible that the parser you are using has different behavior for the underscore character (_). According to the rules, those characters should be interchangeable. Nevertheless, as @user880772 mentioned in a comment, you might want to try using that character rather than an asterisk (*) to see if you can get the desired output as a workaround until the bug is fixed. Like this:

_[text](url)_
[_text_](url)
[_emphasised_ text](url)
like image 115
Waylan Avatar answered Dec 06 '25 19:12

Waylan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!