Permalink
Browse files

Correction display of backtick in LaTeX

  • Loading branch information...
Dimitri van Heesch
Dimitri van Heesch committed Oct 10, 2017
1 parent 4b0b81a commit beaa386ca97341e66ad673660c808993240df637
Showing with 11 additions and 12 deletions.
  1. +9 −12 src/markdown.cpp
  2. +2 −0 src/util.cpp
View
@@ -956,6 +956,15 @@ static int processCodeSpan(GrowBuf &out, const char *data, int /*offset*/, int s
i=0;
nl++;
}
else if (data[end]=='\'' && nb==1 && (end==size-1 || (end<size-1 && !isIdChar(end+1))))
{ // look for quoted strings like `some word', but skip strings like `it's cool`
QCString textFragment;
convertStringFragment(textFragment,data+nb,end-nb);
out.addStr("&lsquo;");
out.addStr(textFragment);
out.addStr("&rsquo;");
return end+1;
}
else
{
i=0;
@@ -982,18 +991,6 @@ static int processCodeSpan(GrowBuf &out, const char *data, int /*offset*/, int s
f_end--;
}
if (nb==1) // check for closing ' followed by space within f_begin..f_end
{
i=f_begin;
while (i<f_end-1)
{
if (data[i]=='\'' && !isIdChar(i+1)) // reject `some word' and not `it's cool`
{
return 0;
}
i++;
}
}
//printf("found code span '%s'\n",QCString(data+f_begin).left(f_end-f_begin).data());
/* real code span */
View
@@ -6733,6 +6733,8 @@ void filterLatexString(FTextStream &t,const char *str,
break;
case '"': t << "\\char`\\\"{}";
break;
case '`': t << "\\`{}";
break;
case '\'': t << "\\textquotesingle{}";
break;
case ' ': if (keepSpaces) { if (insideTabbing) t << "\\>"; else t << '~'; } else t << ' ';

0 comments on commit beaa386

Please sign in to comment.