Permalink
Browse files

Recognize all HTML4 special character entities

In doxygen a limited number of HTML4 special character entities are recognized, with this patch the full list of HTML4 special character entities (see http://www.w3.org/TR/html4/sgml/entities.html) is supported (as far as they can be represented in the output format).

- doxygen_manual.tex
- latexgen.cpp
  Added wasysym package to support per thousand sign (perthousand command from textcomp didn't work properly)
  Added option for textcomp package so currency symbol would work properly

- htmlcmds.doc
  Adjusted documentation, listing all entities

- compound.xsd
- xmlgen.cpp
  Removed in xsd file all references for special HTML4 character entities and placed placeholder so doxygen (in xmlgen.cpp)can automatically add the right element names.

- util.cpp
- util.h
  Define all entities with their representation for all output formats.
  Define access routines to the different representations
  Mapping (for recognition of the entities) based on running through the list of available entities, after validation of the order of the entities. A few entities contain now besides letters also numbers at the end.

- docparser.h
  Define symbols for all entities as well as a helper struct and enum. The member m_letter is not used anymore and thus removed.
  All existing symbols were renamed so no confusion (i.e. errors when forgetting to rename some symbols) can occur.
  Obsolete references to letter removed, all letters with accents etc. are explicitly defined and not through the generic accent name plus an extra letter.

- docparser.cpp
  Adjust used symbols to their new names.
  Remove references to letter (as used for accents etc.)
  Replace list of explicitly supported entities with call to symbol code access routine.

- docbookvisitor.cpp
- htmldocvisitor.cpp
- latexdocvisitor.cpp
- mandocvisitor.cpp
- perlmodgen.cpp
- printdocvisitor.h
- rtfdocvisitor.cpp
- textdocvisitor.cpp
- xmldocvisitor.cpp
  Replace list of explicitly supported entities with call to access routine and use returned value to output.
  • Loading branch information...
albert-github committed Feb 8, 2014
1 parent 0178674 commit 1bd64ac0e925ba2ff069ec64c026ea3c32f85600
Showing with 1,036 additions and 1,537 deletions.
  1. +2 −0 doc/doxygen_manual.tex
  2. +263 −99 doc/htmlcmds.doc
  3. +1 −92 src/compound.xsd
  4. +7 −102 src/docbookvisitor.cpp
  5. +61 −193 src/docparser.cpp
  6. +71 −21 src/docparser.h
  7. +8 −104 src/htmldocvisitor.cpp
  8. +19 −129 src/latexdocvisitor.cpp
  9. +2 −0 src/latexgen.cpp
  10. +8 −35 src/mandocvisitor.cpp
  11. +59 −132 src/perlmodgen.cpp
  12. +7 −99 src/printdocvisitor.h
  13. +7 −191 src/rtfdocvisitor.cpp
  14. +8 −103 src/textdocvisitor.cpp
  15. +449 −133 src/util.cpp
  16. +15 −0 src/util.h
  17. +7 −103 src/xmldocvisitor.cpp
  18. +42 −1 src/xmlgen.cpp
@@ -24,7 +24,9 @@
\usepackage{color}
\usepackage{ifthen}
\usepackage[table]{xcolor}
\PassOptionsToPackage{warn}{textcomp}
\usepackage{textcomp}
\usepackage[nointegrals]{wasysym}
\usepackage{alltt}
\usepackage{ifpdf}
\ifpdf

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -390,94 +390,7 @@
<xsd:element name="anchor" type="docAnchorType" />
<xsd:element name="formula" type="docFormulaType" />
<xsd:element name="ref" type="docRefTextType" />
<xsd:element name="copy" type="docEmptyType" />
<xsd:element name="trademark" type="docEmptyType" />
<xsd:element name="registered" type="docEmptyType" />
<xsd:element name="lsquo" type="docEmptyType" />
<xsd:element name="rsquo" type="docEmptyType" />
<xsd:element name="ldquo" type="docEmptyType" />
<xsd:element name="rdquo" type="docEmptyType" />
<xsd:element name="ndash" type="docEmptyType" />
<xsd:element name="mdash" type="docEmptyType" />
<xsd:element name="umlaut" type="docCharType" />
<xsd:element name="acute" type="docCharType" />
<xsd:element name="grave" type="docCharType" />
<xsd:element name="circ" type="docCharType" />
<xsd:element name="slash" type="docCharType" />
<xsd:element name="tilde" type="docCharType" />
<xsd:element name="cedil" type="docCharType" />
<xsd:element name="ring" type="docCharType" />
<xsd:element name="szlig" type="docEmptyType" />
<xsd:element name="nonbreakablespace" type="docEmptyType" />
<xsd:element name="aelig" type="docEmptyType" />
<xsd:element name="AElig" type="docEmptyType" />
<xsd:element name="Gamma" type="docEmptyType" />
<xsd:element name="Delta" type="docEmptyType" />
<xsd:element name="Theta" type="docEmptyType" />
<xsd:element name="Lambda" type="docEmptyType" />
<xsd:element name="Xi" type="docEmptyType" />
<xsd:element name="Pi" type="docEmptyType" />
<xsd:element name="Sigma" type="docEmptyType" />
<xsd:element name="Upsilon" type="docEmptyType" />
<xsd:element name="Phi" type="docEmptyType" />
<xsd:element name="Psi" type="docEmptyType" />
<xsd:element name="Omega" type="docEmptyType" />
<xsd:element name="alpha" type="docEmptyType" />
<xsd:element name="beta" type="docEmptyType" />
<xsd:element name="gamma" type="docEmptyType" />
<xsd:element name="delta" type="docEmptyType" />
<xsd:element name="epsilon" type="docEmptyType" />
<xsd:element name="zeta" type="docEmptyType" />
<xsd:element name="eta" type="docEmptyType" />
<xsd:element name="theta" type="docEmptyType" />
<xsd:element name="iota" type="docEmptyType" />
<xsd:element name="kappa" type="docEmptyType" />
<xsd:element name="lambda" type="docEmptyType" />
<xsd:element name="mu" type="docEmptyType" />
<xsd:element name="nu" type="docEmptyType" />
<xsd:element name="xi" type="docEmptyType" />
<xsd:element name="pi" type="docEmptyType" />
<xsd:element name="rho" type="docEmptyType" />
<xsd:element name="sigma" type="docEmptyType" />
<xsd:element name="tau" type="docEmptyType" />
<xsd:element name="upsilon" type="docEmptyType" />
<xsd:element name="phi" type="docEmptyType" />
<xsd:element name="chi" type="docEmptyType" />
<xsd:element name="psi" type="docEmptyType" />
<xsd:element name="omega" type="docEmptyType" />
<xsd:element name="sigmaf" type="docEmptyType" />
<xsd:element name="sect" type="docEmptyType" />
<xsd:element name="deg" type="docEmptyType" />
<xsd:element name="prime" type="docEmptyType" />
<xsd:element name="Prime" type="docEmptyType" />
<xsd:element name="infin" type="docEmptyType" />
<xsd:element name="empty" type="docEmptyType" />
<xsd:element name="plusmn" type="docEmptyType" />
<xsd:element name="times" type="docEmptyType" />
<xsd:element name="minus" type="docEmptyType" />
<xsd:element name="sdot" type="docEmptyType" />
<xsd:element name="part" type="docEmptyType" />
<xsd:element name="nabla" type="docEmptyType" />
<xsd:element name="radic" type="docEmptyType" />
<xsd:element name="perp" type="docEmptyType" />
<xsd:element name="sum" type="docEmptyType" />
<xsd:element name="int" type="docEmptyType" />
<xsd:element name="prod" type="docEmptyType" />
<xsd:element name="sim" type="docEmptyType" />
<xsd:element name="asymp" type="docEmptyType" />
<xsd:element name="ne" type="docEmptyType" />
<xsd:element name="equiv" type="docEmptyType" />
<xsd:element name="prop" type="docEmptyType" />
<xsd:element name="le" type="docEmptyType" />
<xsd:element name="ge" type="docEmptyType" />
<xsd:element name="larr" type="docEmptyType" />
<xsd:element name="rarr" type="docEmptyType" />
<xsd:element name="isin" type="docEmptyType" />
<xsd:element name="notin" type="docEmptyType" />
<xsd:element name="lceil" type="docEmptyType" />
<xsd:element name="rceil" type="docEmptyType" />
<xsd:element name="lfloor" type="docEmptyType" />
<xsd:element name="rfloor" type="docEmptyType" />
<!-- Automatically insert here the HTML entities -->
</xsd:choice>
</xsd:group>
@@ -717,10 +630,6 @@
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="docCharType">
<xsd:attribute name="char" type="DoxCharRange"/>
</xsd:complexType>
<xsd:complexType name="docEmptyType"/>
<!-- Simple types -->
@@ -73,109 +73,14 @@ void DocbookDocVisitor::visit(DocWhiteSpace *w)
void DocbookDocVisitor::visit(DocSymbol *s)
{
if (m_hide) return;
switch(s->symbol())
const char *res = get_symbol_docbook(s->symbol());
if (res)
{
case DocSymbol::BSlash: m_t << "\\"; break;
case DocSymbol::At: m_t << "@"; break;
case DocSymbol::Less: m_t << "&lt;"; break;
case DocSymbol::Greater: m_t << "&gt;"; break;
case DocSymbol::Amp: m_t << "&amp;"; break;
case DocSymbol::Dollar: m_t << "$"; break;
case DocSymbol::Hash: m_t << "#"; break;
case DocSymbol::DoubleColon: m_t << "::"; break;
case DocSymbol::Percent: m_t << "%"; break;
case DocSymbol::Copy: m_t << "&#x00A9;"; break;
case DocSymbol::Tm: m_t << "&#8482;"; break;
case DocSymbol::Reg: m_t << "&#174;"; break;
case DocSymbol::Apos: m_t << "&apos;"; break;
case DocSymbol::Quot: m_t << "&quot;"; break;
case DocSymbol::Lsquo: m_t << "&#8216;"; break;
case DocSymbol::Rsquo: m_t << "&#8217;"; break;
case DocSymbol::Ldquo: m_t << "&#8220;"; break;
case DocSymbol::Rdquo: m_t << "&#8221;"; break;
case DocSymbol::Ndash: m_t << "&#8211;"; break;
case DocSymbol::Mdash: m_t << "&#8212;"; break;
case DocSymbol::Uml: m_t << "&#168;"; break;
case DocSymbol::Acute: m_t << "&#180;"; break;
case DocSymbol::Grave: m_t << "&#192;"; break;
case DocSymbol::Circ: m_t << "&#710;"; break;
case DocSymbol::Tilde: m_t << "&#732;"; break;
case DocSymbol::Szlig: m_t << "&#223;"; break;
case DocSymbol::Cedil: m_t << "&#184;"; break;
case DocSymbol::Ring: m_t << "&#197;"; break;
case DocSymbol::Slash: m_t << "&#216;"; break;
case DocSymbol::Nbsp: m_t << "&#160;"; break;
case DocSymbol::Aelig: m_t << "&#230;"; break;
case DocSymbol::AElig: m_t << "&#198;"; break;
case DocSymbol::GrkGamma: m_t << "&#915;"; break;
case DocSymbol::GrkDelta: m_t << "&#916;"; break;
case DocSymbol::GrkTheta: m_t << "&#920;"; break;
case DocSymbol::GrkLambda: m_t << "&#923;"; break;
case DocSymbol::GrkXi: m_t << "&#926;"; break;
case DocSymbol::GrkPi: m_t << "&#928;"; break;
case DocSymbol::GrkSigma: m_t << "&#931;"; break;
case DocSymbol::GrkUpsilon: m_t << "&#933;"; break;
case DocSymbol::GrkPhi: m_t << "&#934;"; break;
case DocSymbol::GrkPsi: m_t << "&#936;"; break;
case DocSymbol::GrkOmega: m_t << "&#937;"; break;
case DocSymbol::Grkalpha: m_t << "&#945;"; break;
case DocSymbol::Grkbeta: m_t << "&#946;"; break;
case DocSymbol::Grkgamma: m_t << "&#947;"; break;
case DocSymbol::Grkdelta: m_t << "&#948;"; break;
case DocSymbol::Grkepsilon: m_t << "&#949;"; break;
case DocSymbol::Grkzeta: m_t << "&#950;"; break;
case DocSymbol::Grketa: m_t << "&#951;"; break;
case DocSymbol::Grktheta: m_t << "&#952;"; break;
case DocSymbol::Grkiota: m_t << "&#953;"; break;
case DocSymbol::Grkkappa: m_t << "&#954;"; break;
case DocSymbol::Grklambda: m_t << "&#955;"; break;
case DocSymbol::Grkmu: m_t << "&#956;"; break;
case DocSymbol::Grknu: m_t << "&#957;"; break;
case DocSymbol::Grkxi: m_t << "&#958;"; break;
case DocSymbol::Grkpi: m_t << "&#960;"; break;
case DocSymbol::Grkrho: m_t << "&#961;"; break;
case DocSymbol::Grksigma: m_t << "&#963;"; break;
case DocSymbol::Grktau: m_t << "&#964;"; break;
case DocSymbol::Grkupsilon: m_t << "&#965;"; break;
case DocSymbol::Grkphi: m_t << "&#966;"; break;
case DocSymbol::Grkchi: m_t << "&#967;"; break;
case DocSymbol::Grkpsi: m_t << "&#968;"; break;
case DocSymbol::Grkomega: m_t << "&#969;"; break;
case DocSymbol::Grkvarsigma: m_t << "&#962;"; break;
case DocSymbol::Section: m_t << "<simplesect/>"; break;
case DocSymbol::Degree: m_t << "&#176;"; break;
case DocSymbol::Prime: m_t << "&#8242;"; break;
case DocSymbol::DoublePrime: m_t << "&#8243;"; break;
case DocSymbol::Infinity: m_t << "&#8734;"; break;
case DocSymbol::EmptySet: m_t << "&#8709;"; break;
case DocSymbol::PlusMinus: m_t << "&#177;"; break;
case DocSymbol::Times: m_t << "&#215;"; break;
case DocSymbol::Minus: m_t << "&#8722;"; break;
case DocSymbol::CenterDot: m_t << "&#8901;"; break;
case DocSymbol::Partial: m_t << "&#8706;"; break;
case DocSymbol::Nabla: m_t << "&#8711;"; break;
case DocSymbol::SquareRoot: m_t << "&#8730;"; break;
case DocSymbol::Perpendicular: m_t << "&#8869;"; break;
case DocSymbol::Sum: m_t << "&#8721;"; break;
case DocSymbol::Integral: m_t << "&#8747;"; break;
case DocSymbol::Product: m_t << "&#8719;"; break;
case DocSymbol::Similar: m_t << "&#8764;"; break;
case DocSymbol::Approx: m_t << "&#8776;"; break;
case DocSymbol::NotEqual: m_t << "&#8800;"; break;
case DocSymbol::Equivalent: m_t << "&#8801;"; break;
case DocSymbol::Proportional: m_t << "&#8733;"; break;
case DocSymbol::LessEqual: m_t << "&#8804;"; break;
case DocSymbol::GreaterEqual: m_t << "&#8805;"; break;
case DocSymbol::LeftArrow: m_t << "&#8592;"; break;
case DocSymbol::RightArrow: m_t << "&#8594;"; break;
case DocSymbol::SetIn: m_t << "&#8712;"; break;
case DocSymbol::SetNotIn: m_t << "&#8713;"; break;
case DocSymbol::LeftCeil: m_t << "&#8968;"; break;
case DocSymbol::RightCeil: m_t << "&#8969;"; break;
case DocSymbol::LeftFloor: m_t << "&#8970;"; break;
case DocSymbol::RightFloor: m_t << "&#8971;"; break;
default:
err("unknown symbol found\n");
m_t << res;
}
else
{
err("DocBook: non supported HTML-entity found: &%s;\n",get_symbol_item(s->symbol()));
}
}
Oops, something went wrong.

0 comments on commit 1bd64ac

Please sign in to comment.