Skip to content

Commit c1eba97

Browse files
committed
Text show as formula when USE_MATHJAX=YES (2)
Analogous to the problem fixed in doxygen#7697 for `\( ...\)` a similar problem can occur for `\[ .... \]`
1 parent c829073 commit c1eba97

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/htmldocvisitor.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2119,7 +2119,8 @@ void HtmlDocVisitor::filter(const QCString &str, const bool retainNewline)
21192119
case '<': m_t << "&lt;"; break;
21202120
case '>': m_t << "&gt;"; break;
21212121
case '&': m_t << "&amp;"; break;
2122-
case '\\': if ((*p == '(') || (*p == ')'))
2122+
case '\\':
2123+
if ((*p == '(') || (*p == ')') || (*p == '[') || (*p == ']'))
21232124
m_t << "\\&zwj;" << *p++;
21242125
else
21252126
m_t << c;
@@ -2158,7 +2159,7 @@ QCString HtmlDocVisitor::filterQuotedCdataAttr(const QCString &str)
21582159
case '<': growBuf.addStr("&lt;"); break;
21592160
case '>': growBuf.addStr("&gt;"); break;
21602161
case '\\':
2161-
if ((*p == '(') || (*p == ')'))
2162+
if ((*p == '(') || (*p == ')') || (*p == '[') || (*p == ']'))
21622163
{
21632164
growBuf.addStr("\\&zwj;");
21642165
growBuf.addChar(*p++);

src/htmlgen.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -813,6 +813,10 @@ void HtmlCodeGenerator::codify(const QCString &str)
813813
{ *m_t << "&lt;"; p++; }
814814
else if (*p=='>')
815815
{ *m_t << "&gt;"; p++; }
816+
else if (*p=='[')
817+
{ *m_t << "\\&zwj;["; m_col++;p++; }
818+
else if (*p==']')
819+
{ *m_t << "\\&zwj;]"; m_col++;p++; }
816820
else if (*p=='(')
817821
{ *m_t << "\\&zwj;("; m_col++;p++; }
818822
else if (*p==')')
@@ -1968,6 +1972,10 @@ void HtmlGenerator::docify_(const QCString &str,bool inHtmlComment)
19681972
{ m_t << "&lt;"; p++; }
19691973
else if (*p=='>')
19701974
{ m_t << "&gt;"; p++; }
1975+
else if (*p=='[')
1976+
{ m_t << "\\&zwj;["; p++; }
1977+
else if (*p==']')
1978+
{ m_t << "\\&zwj;]"; p++; }
19711979
else if (*p=='(')
19721980
{ m_t << "\\&zwj;("; p++; }
19731981
else if (*p==')')

0 commit comments

Comments
 (0)