From db1d1fa78e53248ea96a26700b52c393f54c521f Mon Sep 17 00:00:00 2001 From: Jan Theegarten Date: Thu, 7 Jan 2021 14:45:07 +0100 Subject: Add width attribute of tables and table cells to xml output. --- src/xmldocvisitor.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/xmldocvisitor.cpp b/src/xmldocvisitor.cpp index 77f3e8e..30a5f01 100644 --- a/src/xmldocvisitor.cpp +++ b/src/xmldocvisitor.cpp @@ -778,7 +778,17 @@ void XmlDocVisitor::visitPre(DocHtmlTable *t) { if (m_hide) return; m_t << "numRows() - << "\" cols=\"" << t->numColumns() << "\">" ; + << "\" cols=\"" << t->numColumns() << "\"" ; + HtmlAttribListIterator li(t->attribs()); + HtmlAttrib* opt; + for (li.toFirst(); (opt = li.current()); ++li) + { + if (opt->name == "width") + { + m_t << " " << opt->name << "=\"" << opt->value << "\""; + } + } + m_t << ">"; } void XmlDocVisitor::visitPost(DocHtmlTable *) @@ -816,7 +826,11 @@ void XmlDocVisitor::visitPre(DocHtmlCell *c) { m_t << " align=\"" << opt->value << "\""; } - else if (opt->name=="class") // handle markdown generated attributes + else if (opt->name == "width") + { + m_t << " width=\"" << opt->value << "\""; + } + else if (opt->name == "class") // handle markdown generated attributes { if (opt->value.left(13)=="markdownTable") // handle markdown generated attributes { -- cgit v0.12