diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2010-10-09 08:04:33 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2010-10-09 08:04:33 (GMT) |
commit | 8a48f6c3f4827171edf41a40bfdbc03e53d9be6b (patch) | |
tree | fac3e1fdcea37381cbfa5042e20155883cf97372 /src/htmldocvisitor.cpp | |
parent | 6dbef217c477d43fb61e90b429531ee109bf0e75 (diff) | |
download | Doxygen-8a48f6c3f4827171edf41a40bfdbc03e53d9be6b.zip Doxygen-8a48f6c3f4827171edf41a40bfdbc03e53d9be6b.tar.gz Doxygen-8a48f6c3f4827171edf41a40bfdbc03e53d9be6b.tar.bz2 |
Release-1.7.2
Diffstat (limited to 'src/htmldocvisitor.cpp')
-rw-r--r-- | src/htmldocvisitor.cpp | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/src/htmldocvisitor.cpp b/src/htmldocvisitor.cpp index 7de6e52..cfe229e 100644 --- a/src/htmldocvisitor.cpp +++ b/src/htmldocvisitor.cpp @@ -490,14 +490,36 @@ void HtmlDocVisitor::visit(DocFormula *f) forceEndParagraph(f); m_t << "<p class=\"formulaDsp\">" << endl; } - m_t << "<img class=\"formula" + + if (Config_getBool("USE_MATHJAX")) + { + QCString text = f->text(); + bool closeInline = FALSE; + if (!bDisplay && !text.isEmpty() && text.at(0)=='$' && + text.at(text.length()-1)=='$') + { + closeInline=TRUE; + text = text.mid(1,text.length()-2); + m_t << "\\("; + } + m_t << convertToHtml(text); + if (closeInline) + { + m_t << "\\)"; + } + } + else + { + m_t << "<img class=\"formula" << (bDisplay ? "Dsp" : "Inl"); - m_t << "\" alt=\""; - filterQuotedCdataAttr(f->text()); - m_t << "\""; - /// @todo cache image dimensions on formula generation and give height/width - /// for faster preloading and better rendering of the page - m_t << " src=\"" << f->relPath() << f->name() << ".png\"/>"; + m_t << "\" alt=\""; + filterQuotedCdataAttr(f->text()); + m_t << "\""; + /// @todo cache image dimensions on formula generation and give height/width + /// for faster preloading and better rendering of the page + m_t << " src=\"" << f->relPath() << f->name() << ".png\"/>"; + + } if (bDisplay) { m_t << endl << "</p>" << endl; |