Skip to content

Commit

Permalink
issue #8755 :: lost in nested names when using markdown
Browse files Browse the repository at this point in the history
During the translation of the back ticks the double colons following a `>` should be escaped as well ass otherwise the `::` might be seen as an indication for a global class name etc.
  • Loading branch information
albert-github committed Sep 2, 2021
1 parent c9fc3ac commit dd97018
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/markdown.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,23 @@ static QCString escapeSpecialChars(const QCString &s)
switch (c)
{
case '"': if (pc!='\\') { insideQuote=!insideQuote; } growBuf.addChar(c); break;
case '<': if (!insideQuote) { growBuf.addChar('\\'); } growBuf.addChar('<'); break;
case '>': if (!insideQuote) { growBuf.addChar('\\'); } growBuf.addChar('>'); break;
case '<':
case '>': if (!insideQuote)
{
growBuf.addChar('\\');
growBuf.addChar(c);
if ((p[0] == ':') && (p[1] == ':'))
{
growBuf.addChar('\\');
growBuf.addChar(':');
p++;
}
}
else
{
growBuf.addChar(c);
}
break;
case '\\': if (!insideQuote) { growBuf.addChar('\\'); } growBuf.addChar('\\'); break;
case '@': if (!insideQuote) { growBuf.addChar('\\'); } growBuf.addChar('@'); break;
case '#': if (!insideQuote) { growBuf.addChar('\\'); } growBuf.addChar('#'); break;
Expand Down

0 comments on commit dd97018

Please sign in to comment.