diff options
author | albert-github <albert.tests@gmail.com> | 2015-01-11 18:56:26 (GMT) |
---|---|---|
committer | albert-github <albert.tests@gmail.com> | 2015-01-11 18:56:26 (GMT) |
commit | 8e44571521391403e8d85f893acb926e021e926b (patch) | |
tree | 39873cce1738c64bd91e2b2e17f7baf76a03ac2c | |
parent | 081e3a9f921dc335422773526d53c8b99fb32147 (diff) | |
download | Doxygen-8e44571521391403e8d85f893acb926e021e926b.zip Doxygen-8e44571521391403e8d85f893acb926e021e926b.tar.gz Doxygen-8e44571521391403e8d85f893acb926e021e926b.tar.bz2 |
Bug 739680 - Using HTML entities in PROJECT_NAME
Implementation for LaTeX of special symbols by scanning string in case a & is found.
-rw-r--r-- | src/util.cpp | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/src/util.cpp b/src/util.cpp index 00173fb..1bd2ce9 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -6452,6 +6452,8 @@ void filterLatexString(FTextStream &t,const char *str, //printf("filterLatexString(%s)\n",str); //if (strlen(str)<2) stackTrace(); const unsigned char *p=(const unsigned char *)str; + const unsigned char *q; + int cnt; unsigned char c; unsigned char pc='\0'; while (*p) @@ -6478,7 +6480,34 @@ void filterLatexString(FTextStream &t,const char *str, case '$': t << "\\$"; break; case '%': t << "\\%"; break; case '^': t << "$^\\wedge$"; break; - case '&': t << "\\&"; break; + case '&': // possibility to have a special symbol + q = p; + cnt = 2; // we have to count & and ; as well + while (*q && *q != ';') + { + cnt++; + q++; + } + if (*q == ';') + { + --p; // we need & as well + DocSymbol::SymType res = HtmlEntityMapper::instance()->name2sym(QCString((char *)p).left(cnt)); + if (res == DocSymbol::Sym_Unknown) + { + p++; + t << "\\&"; + } + else + { + t << HtmlEntityMapper::instance()->latex(res); + p = q; + } + } + else + { + t << "\\&"; + } + break; case '*': t << "$\\ast$"; break; case '_': if (!insideTabbing) t << "\\+"; t << "\\_"; |