summaryrefslogtreecommitdiffstats
path: root/src/htmldocvisitor.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2013-05-12 13:04:34 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2013-05-12 13:04:34 (GMT)
commit8dc4ff6dd22b1603f33537ff03994cc63e658768 (patch)
tree97f0e23b93d45b7917d965e6d1bb70da6c61831a /src/htmldocvisitor.cpp
parentebf4b3641c9149eaf4468aa8df64e1c7517e5f0c (diff)
downloadDoxygen-8dc4ff6dd22b1603f33537ff03994cc63e658768.zip
Doxygen-8dc4ff6dd22b1603f33537ff03994cc63e658768.tar.gz
Doxygen-8dc4ff6dd22b1603f33537ff03994cc63e658768.tar.bz2
Release-1.8.3.1-20130512
Diffstat (limited to 'src/htmldocvisitor.cpp')
-rw-r--r--src/htmldocvisitor.cpp39
1 files changed, 22 insertions, 17 deletions
diff --git a/src/htmldocvisitor.cpp b/src/htmldocvisitor.cpp
index d334e8f..767fa5b 100644
--- a/src/htmldocvisitor.cpp
+++ b/src/htmldocvisitor.cpp
@@ -39,26 +39,30 @@ static const char types[][NUM_HTML_LIST_TYPES] = {"1", "a", "i", "A"};
static QCString convertIndexWordToAnchor(const QString &word)
{
static char hex[] = "0123456789abcdef";
- uint i;
QCString result;
- for (i=0;i<word.length();i++)
- {
- int c = word.at(i);
- if (isId(c))
+ const char *str = word.data();
+ unsigned char c;
+ while ((c = *str++))
+ {
+ if ((c >= 'a' && c <= 'z') || // ALPHA
+ (c >= 'A' && c <= 'A') || // ALPHA
+ (c >= '0' && c <= '9') || // DIGIT
+ c == '-' ||
+ c == '.' ||
+ c == '_' ||
+ c == '~'
+ )
{
- result+=c;
+ result += c;
}
- else if (isspace(c))
- {
- result+="_";
- }
- else
+ else
{
- char cs[3];
- cs[0]=hex[c>>4];
- cs[1]=hex[c&0xf];
- cs[2]=0;
- result+=cs;
+ char enc[4];
+ enc[0] = '%';
+ enc[1] = hex[(c & 0xf0) >> 4];
+ enc[2] = hex[c & 0xf];
+ enc[3] = 0;
+ result += enc;
}
}
return result;
@@ -153,6 +157,7 @@ void HtmlDocVisitor::visit(DocWord *w)
void HtmlDocVisitor::visit(DocLinkedWord *w)
{
if (m_hide) return;
+ //printf("linked word: %s\n",w->word().data());
startLink(w->ref(),w->file(),w->relPath(),w->anchor(),w->tooltip());
filter(w->word());
endLink();
@@ -277,7 +282,7 @@ void HtmlDocVisitor::visit(DocSymbol *s)
case DocSymbol::LeftFloor: m_t << "&lfloor;"; break;
case DocSymbol::RightFloor: m_t << "&rfloor;"; break;
default:
- err("error: unknown symbol found\n");
+ err("unknown symbol found\n");
}
}