Skip to content

Commit db1d1fa

Browse files
author
Jan Theegarten
committed
Add width attribute of tables and table cells to xml output.
1 parent c37fe44 commit db1d1fa

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

src/xmldocvisitor.cpp

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,17 @@ void XmlDocVisitor::visitPre(DocHtmlTable *t)
778778
{
779779
if (m_hide) return;
780780
m_t << "<table rows=\"" << t->numRows()
781-
<< "\" cols=\"" << t->numColumns() << "\">" ;
781+
<< "\" cols=\"" << t->numColumns() << "\"" ;
782+
HtmlAttribListIterator li(t->attribs());
783+
HtmlAttrib* opt;
784+
for (li.toFirst(); (opt = li.current()); ++li)
785+
{
786+
if (opt->name == "width")
787+
{
788+
m_t << " " << opt->name << "=\"" << opt->value << "\"";
789+
}
790+
}
791+
m_t << ">";
782792
}
783793

784794
void XmlDocVisitor::visitPost(DocHtmlTable *)
@@ -816,7 +826,11 @@ void XmlDocVisitor::visitPre(DocHtmlCell *c)
816826
{
817827
m_t << " align=\"" << opt->value << "\"";
818828
}
819-
else if (opt->name=="class") // handle markdown generated attributes
829+
else if (opt->name == "width")
830+
{
831+
m_t << " width=\"" << opt->value << "\"";
832+
}
833+
else if (opt->name == "class") // handle markdown generated attributes
820834
{
821835
if (opt->value.left(13)=="markdownTable") // handle markdown generated attributes
822836
{

0 commit comments

Comments
 (0)