Skip to content

Commit

Permalink
Bug 739680 - Using HTML entities in PROJECT_NAME
Browse files Browse the repository at this point in the history
Implementation for LaTeX of special symbols by scanning string in case a & is found.
  • Loading branch information
albert-github committed Jan 11, 2015
1 parent 081e3a9 commit 8e44571
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion src/util.cpp
Expand Up @@ -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)
Expand All @@ -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 << "\\_";
Expand Down

0 comments on commit 8e44571

Please sign in to comment.