From 1de4faf17a4b5de11839220d95e08264303924c5 Mon Sep 17 00:00:00 2001 From: albert-github Date: Sun, 1 Jul 2018 11:08:27 +0200 Subject: Tooltip was twice 'HTML escaped' The tooltip was already 'HTML escaped' except for some '<' and '>' characters but was again 'HTML escaped' resulting in e.g. that a single apostrophe (') was translated to ' and again to &#39; resulting in ' in the tooltip. Only '<' and '>' are now 'HTML escaped again' --- src/htmlgen.cpp | 23 ++++++++++++++++++++++- src/htmlgen.h | 1 + 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp index 740b2f5..8feb8b0 100644 --- a/src/htmlgen.cpp +++ b/src/htmlgen.cpp @@ -514,6 +514,27 @@ void HtmlCodeGenerator::docify(const char *str) } } +void HtmlCodeGenerator::docify_tt(const char *str) +{ + m_t << getHtmlDirEmbedingChar(getTextDirByConfig(str)); + + if (str && m_streamSet) + { + const char *p=str; + char c; + while (*p) + { + c=*p++; + switch(c) + { + case '<': m_t << "<"; break; + case '>': m_t << ">"; break; + default: m_t << c; + } + } + } +} + void HtmlCodeGenerator::writeLineNumber(const char *ref,const char *filename, const char *anchor,int l) { @@ -606,7 +627,7 @@ void HtmlCodeGenerator::writeTooltip(const char *id, const DocLinkInfo &docInfo, if (desc) { m_t << "
"; - docify(desc); // desc is already HTML escaped; but there are still < and > signs + docify_tt(desc); // desc is already HTML escaped; but there are still < and > signs m_t << "
"; } if (!defInfo.file.isEmpty()) diff --git a/src/htmlgen.h b/src/htmlgen.h index 2d8d6e0..b80d7d4 100644 --- a/src/htmlgen.h +++ b/src/htmlgen.h @@ -61,6 +61,7 @@ class HtmlCodeGenerator : public CodeOutputInterface const char *anchor,const char *name, const char *tooltip); void docify(const char *str); + void docify_tt(const char *str); bool m_streamSet; FTextStream m_t; int m_col; -- cgit v0.12