summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/latexdocvisitor.cpp30
-rwxr-xr-xsrc/util.cpp3
2 files changed, 6 insertions, 27 deletions
diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp
index 467800c..2b590ed 100644
--- a/src/latexdocvisitor.cpp
+++ b/src/latexdocvisitor.cpp
@@ -34,30 +34,6 @@
#include "htmlentity.h"
#include "plantuml.h"
-static QCString escapeLabelName(const char *s)
-{
- QCString result;
- const char *p=s;
- char c;
- if (p)
- {
- while ((c=*p++))
- {
- switch (c)
- {
- case '%': result+="\\%"; break;
- case '|': result+="\\texttt{\"|}"; break;
- case '!': result+="\"!"; break;
- case '{': result+="\\lcurly{}"; break;
- case '}': result+="\\rcurly{}"; break;
- case '~': result+="````~"; break; // to get it a bit better in index together with other special characters
- default: result+=c;
- }
- }
- }
- return result;
-}
-
const int maxLevels=5;
static const char *secLabels[maxLevels] =
{ "section","subsection","subsubsection","paragraph","subparagraph" };
@@ -556,8 +532,10 @@ void LatexDocVisitor::visit(DocFormula *f)
void LatexDocVisitor::visit(DocIndexEntry *i)
{
if (m_hide) return;
- m_t << "\\index{" << escapeLabelName(i->entry()) << "@{";
- escapeMakeIndexChars(i->entry());
+ m_t << "\\index{";
+ m_t << latexEscapeLabelName(i->entry(),false);
+ m_t << "@{";
+ m_t << latexEscapeIndexChars(i->entry(),false);
m_t << "}}";
}
diff --git a/src/util.cpp b/src/util.cpp
index efd3d3c..f1ebf8b 100755
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -6744,6 +6744,7 @@ QCString latexEscapeLabelName(const char *s,bool insideTabbing)
{
case '|': t << "\\texttt{\"|}"; break;
case '!': t << "\"!"; break;
+ case '@': t << "\"@"; break;
case '%': t << "\\%"; break;
case '{': t << "\\lcurly{}"; break;
case '}': t << "\\rcurly{}"; break;
@@ -6753,7 +6754,7 @@ QCString latexEscapeLabelName(const char *s,bool insideTabbing)
i=0;
// collect as long string as possible, before handing it to docify
tmp[i++]=c;
- while ((c=*p) && c!='|' && c!='!' && c!='%' && c!='{' && c!='}' && c!='~')
+ while ((c=*p) && c!='@' && c!='[' && c!=']' && c!='!' && c!='{' && c!='}' && c!='|')
{
tmp[i++]=c;
p++;