diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2020-02-02 13:02:03 (GMT) |
---|---|---|
committer | Dimitri van Heesch <doxygen@gmail.com> | 2020-02-02 13:02:03 (GMT) |
commit | ba2f1f99357d4a93d648cb6e7c3f7cfbb56244de (patch) | |
tree | 82488a1c3d2465d3c50d3aa9c65f7652a585797e | |
parent | 2faf90d076b3e1ec2d13597341cb8220fe15be9f (diff) | |
parent | 90fb3132ce02eb44abe3797954267fefcb8d10a8 (diff) | |
download | Doxygen-ba2f1f99357d4a93d648cb6e7c3f7cfbb56244de.zip Doxygen-ba2f1f99357d4a93d648cb6e7c3f7cfbb56244de.tar.gz Doxygen-ba2f1f99357d4a93d648cb6e7c3f7cfbb56244de.tar.bz2 |
Merge branch 'albert-github-feature/bug_791390'
-rw-r--r-- | src/docbookvisitor.cpp | 93 | ||||
-rw-r--r-- | src/xmldocvisitor.cpp | 44 | ||||
-rw-r--r-- | templates/html/doxygen.css | 41 | ||||
-rw-r--r-- | templates/xml/compound.xsd | 14 |
4 files changed, 94 insertions, 98 deletions
diff --git a/src/docbookvisitor.cpp b/src/docbookvisitor.cpp index e6d0014..4b4de4a 100644 --- a/src/docbookvisitor.cpp +++ b/src/docbookvisitor.cpp @@ -69,6 +69,21 @@ static QCString filterId(const char *s) return growBuf.get(); } +static bool supportedHtmlAttribute(const QCString &name) +{ + return (name=="align" || + name=="bgcolor" || + name=="border" || + name=="cellpadding" || + name=="cellspacing" || + name=="class" || + name=="frame" || + name=="label" || + name=="tabstyle" || + name=="title"); +} + + void DocbookDocVisitor::visitCaption(const QList<DocNode> &children) { QListIterator<DocNode> cli(children); @@ -1034,25 +1049,10 @@ DB_VIS_C HtmlAttrib *opt; for (li.toFirst();(opt=li.current());++li) { - if (opt->name=="class") - { - // just skip it - } - else if (opt->name=="style") - { - // just skip it - } - else if (opt->name=="height") - { - // just skip it - } - else if (opt->name=="filter") - { - // just skip it - } - else + if (supportedHtmlAttribute(opt->name)) { - m_t << " " << opt->name << "='" << opt->value << "'"; + // process supported attributes only + m_t << " " << opt->name << "='" << convertToDocBook(opt->value) << "'"; } } m_t << ">\n"; @@ -1095,50 +1095,31 @@ DB_VIS_C } else if (opt->name=="class") { - if (opt->value == "markdownTableBodyRight") - { - m_t << " align='right'"; - } - else if (opt->value == "markdownTableBodyLeftt") - { - m_t << " align='left'"; - } - else if (opt->value == "markdownTableBodyCenter") - { - m_t << " align='center'"; - } - else if (opt->value == "markdownTableHeadRight") + if (opt->value.left(13)=="markdownTable") // handle markdown generated attributes { - m_t << " align='right'"; - } - else if (opt->value == "markdownTableHeadLeftt") - { - m_t << " align='left'"; + if (opt->value.right(5)=="Right") + { + m_t << " align='right'"; + } + else if (opt->value.right(4)=="Left") + { + m_t << " align='left'"; + } + else if (opt->value.right(6)=="Center") + { + m_t << " align='center'"; + } + // skip 'markdownTable*' value ending with "None" } - else if (opt->value == "markdownTableHeadCenter") + else { - m_t << " align='center'"; + m_t << " class='" << convertToDocBook(opt->value) << "'"; } } - else if (opt->name=="style") - { - // just skip it - } - else if (opt->name=="width") - { - // just skip it - } - else if (opt->name=="height") - { - // just skip it - } - else if (opt->name=="nowrap" && opt->value.isEmpty()) - { - m_t << " " << opt->name << "='nowrap'"; - } - else + else if (supportedHtmlAttribute(opt->name)) { - m_t << " " << opt->name << "='" << opt->value << "'"; + // process supported attributes only + m_t << " " << opt->name << "='" << convertToDocBook(opt->value) << "'"; } } m_t << ">"; diff --git a/src/xmldocvisitor.cpp b/src/xmldocvisitor.cpp index 0aafd47..31eeb16 100644 --- a/src/xmldocvisitor.cpp +++ b/src/xmldocvisitor.cpp @@ -806,7 +806,49 @@ void XmlDocVisitor::visitPost(DocHtmlRow *) void XmlDocVisitor::visitPre(DocHtmlCell *c) { if (m_hide) return; - if (c->isHeading()) m_t << "<entry thead=\"yes\">"; else m_t << "<entry thead=\"no\">"; + if (c->isHeading()) m_t << "<entry thead=\"yes\""; else m_t << "<entry thead=\"no\""; + HtmlAttribListIterator li(c->attribs()); + HtmlAttrib *opt; + for (li.toFirst();(opt=li.current());++li) + { + if (opt->name=="colspan" || opt->name=="rowspan") + { + m_t << " " << opt->name << "=\"" << opt->value.toInt() << "\""; + } + else if (opt->name=="align" && + (opt->value=="right" || opt->value=="left" || opt->value=="center")) + { + m_t << " align=\"" << opt->value << "\""; + } + else if (opt->name=="class") // handle markdown generated attributes + { + if (opt->value.left(13)=="markdownTable") // handle markdown generated attributes + { + if (opt->value.right(5)=="Right") + { + m_t << " align='right'"; + } + else if (opt->value.right(4)=="Left") + { + m_t << " align='left'"; + } + else if (opt->value.right(6)=="Center") + { + m_t << " align='center'"; + } + // skip 'markdownTable*' value ending with "None" + } + else if (!opt->value.isEmpty()) + { + m_t << " class=\"" << convertToXML(opt->value) << "\""; + } + } + else if (!opt->name.isEmpty() && !opt->value.isEmpty()) // dump generic html attribute + { + m_t << " htmlattrib=\"" << convertToXML(opt->name) << "=" << convertToXML(opt->value) << "\""; + } + } + m_t << ">"; } void XmlDocVisitor::visitPost(DocHtmlCell *) diff --git a/templates/html/doxygen.css b/templates/html/doxygen.css index 2c9dfd5..8f2c213 100644 --- a/templates/html/doxygen.css +++ b/templates/html/doxygen.css @@ -1661,47 +1661,6 @@ tr.heading h2 { /* @group Markdown */ -/* -table.markdownTable { - border-collapse:collapse; - margin-top: 4px; - margin-bottom: 4px; -} - -table.markdownTable td, table.markdownTable th { - border: 1px solid ##37; - padding: 3px 7px 2px; -} - -table.markdownTableHead tr { -} - -table.markdownTableBodyLeft td, table.markdownTable th { - border: 1px solid ##37; - padding: 3px 7px 2px; -} - -th.markdownTableHeadLeft th.markdownTableHeadRight th.markdownTableHeadCenter th.markdownTableHeadNone { - background-color: ##47; - color: ##ff; - font-size: 110%; - padding-bottom: 4px; - padding-top: 5px; -} - -th.markdownTableHeadLeft { - text-align: left -} - -th.markdownTableHeadRight { - text-align: right -} - -th.markdownTableHeadCenter { - text-align: center -} -*/ - table.markdownTable { border-collapse:collapse; margin-top: 4px; diff --git a/templates/xml/compound.xsd b/templates/xml/compound.xsd index 67d7843..277a584 100644 --- a/templates/xml/compound.xsd +++ b/templates/xml/compound.xsd @@ -570,6 +570,12 @@ <xsd:element name="para" type="docParaType" minOccurs="0" maxOccurs="unbounded" /> </xsd:sequence> <xsd:attribute name="thead" type="DoxBool" /> + <xsd:attribute name="colspan" type="xsd:integer" /> + <xsd:attribute name="rowspan" type="xsd:integer" /> + <xsd:attribute name="align" type="DoxAlign" /> + <xsd:attribute name="class" type="xsd:string" /> + <xsd:attribute name="htmlattrib" type="xsd:string" /> + <xsd:anyAttribute processContents="skip"/> </xsd:complexType> <xsd:complexType name="docCaptionType" mixed="true"> @@ -936,5 +942,13 @@ </xsd:restriction> </xsd:simpleType> + <xsd:simpleType name="DoxAlign"> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="left"/> + <xsd:enumeration value="right"/> + <xsd:enumeration value="center"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:schema> |