summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2015-01-24 18:06:45 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2015-01-24 18:06:45 (GMT)
commitb007f54075bf82024b0f0e07fa9af9df3073c8dd (patch)
treeb8a4823604ce900abd0034f964ba53683af7c39b
parentf67f801d897ad368399f03c34b5a6b65764c0a72 (diff)
parenta0820f29e60be1555b5b0c92a975bf334b6f5258 (diff)
downloadDoxygen-b007f54075bf82024b0f0e07fa9af9df3073c8dd.zip
Doxygen-b007f54075bf82024b0f0e07fa9af9df3073c8dd.tar.gz
Doxygen-b007f54075bf82024b0f0e07fa9af9df3073c8dd.tar.bz2
Merge pull request #290 from albert-github/feature/bug_739680_project_name
Bug 739680 - Using HTML entities in PROJECT_NAME
-rw-r--r--src/util.cpp32
1 files changed, 31 insertions, 1 deletions
diff --git a/src/util.cpp b/src/util.cpp
index 00173fb..d6869d3 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,35 @@ 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 >= 'a' && *q <= 'z') || (*q >= 'A' && *q <= 'Z') || (*q >= '0' && *q <= '9'))
+ {
+ 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);
+ q++;
+ p = q;
+ }
+ }
+ else
+ {
+ t << "\\&";
+ }
+ break;
case '*': t << "$\\ast$"; break;
case '_': if (!insideTabbing) t << "\\+";
t << "\\_";