summaryrefslogtreecommitdiffstats
path: root/src/context.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2020-11-28 14:32:25 (GMT)
committerDimitri van Heesch <doxygen@gmail.com>2020-11-28 14:32:25 (GMT)
commit06eb8c6edcb0df79717f9cf3afb4061b57157382 (patch)
tree934b1969b99c9e8656d16ca811b8104897fb1bba /src/context.cpp
parente16e8f3c094f073d08a49bb8397bb251c18af3f7 (diff)
downloadDoxygen-06eb8c6edcb0df79717f9cf3afb4061b57157382.zip
Doxygen-06eb8c6edcb0df79717f9cf3afb4061b57157382.tar.gz
Doxygen-06eb8c6edcb0df79717f9cf3afb4061b57157382.tar.bz2
issue #697: Test 32 reference to bell signal (XHTML, LaTeX)
Diffstat (limited to 'src/context.cpp')
-rw-r--r--src/context.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/context.cpp b/src/context.cpp
index fc8833d..074e6ec 100644
--- a/src/context.cpp
+++ b/src/context.cpp
@@ -3802,6 +3802,7 @@ class TextGeneratorHtml : public TextGeneratorIntf
: m_ts(ts), m_relPath(relPath) {}
void writeString(const char *s,bool keepSpaces) const
{
+ static const char *hex="0123456789ABCDEF";
if (s==0) return;
if (keepSpaces)
{
@@ -3817,6 +3818,19 @@ class TextGeneratorHtml : public TextGeneratorIntf
case '"': m_ts << "&quot;"; break;
case '&': m_ts << "&amp;"; break;
case ' ': m_ts << "&#160;"; break;
+ default:
+ {
+ uchar uc = static_cast<uchar>(c);
+ if (uc<32 && !isspace(c)) // non-printable control characters
+ {
+ m_ts << "&#x24" << hex[uc>>4] << hex[uc&0xF] << ";";
+ }
+ else
+ {
+ m_ts << c;
+ }
+ }
+ break;
}
}
}