diff options
-rw-r--r-- | src/markdown.cpp | 21 | ||||
-rw-r--r-- | src/util.cpp | 2 |
2 files changed, 11 insertions, 12 deletions
diff --git a/src/markdown.cpp b/src/markdown.cpp index 0d98410..42ec49d 100644 --- a/src/markdown.cpp +++ b/src/markdown.cpp @@ -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("‘"); + out.addStr(textFragment); + out.addStr("’"); + 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 */ diff --git a/src/util.cpp b/src/util.cpp index 1b169cb..d3d7dfe 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -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 << ' '; |