diff options
Diffstat (limited to 'src/xmldocvisitor.cpp')
-rw-r--r-- | src/xmldocvisitor.cpp | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/src/xmldocvisitor.cpp b/src/xmldocvisitor.cpp index 73aac7c..29990c9 100644 --- a/src/xmldocvisitor.cpp +++ b/src/xmldocvisitor.cpp @@ -41,7 +41,7 @@ static void visitCaption(XmlDocVisitor *parent, QList<DocNode> children) static void visitPreStart(FTextStream &t, const char *cmd, bool doCaption, XmlDocVisitor *parent, QList<DocNode> children, const QCString &name, bool writeType, DocImage::Type type, const QCString &width, - const QCString &height, bool inlineImage = FALSE) + const QCString &height, const QCString &alt = QCString(""), bool inlineImage = FALSE) { t << "<" << cmd; if (writeType) @@ -68,6 +68,10 @@ static void visitPreStart(FTextStream &t, const char *cmd, bool doCaption, { t << " height=\"" << convertToXML(height) << "\""; } + if (!alt.isEmpty()) + { + t << " alt=\"" << convertToXML(alt) << "\""; + } if (inlineImage) { t << " inline=\"yes\""; @@ -774,7 +778,17 @@ void XmlDocVisitor::visitPre(DocHtmlTable *t) { if (m_hide) return; m_t << "<table rows=\"" << 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 *) @@ -812,6 +826,15 @@ void XmlDocVisitor::visitPre(DocHtmlCell *c) { m_t << " align=\"" << opt->value << "\""; } + else if (opt->name=="valign" && + (opt->value == "bottom" || opt->value == "top" || opt->value == "middle")) + { + m_t << " valign=\"" << opt->value << "\""; + } + 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 @@ -907,7 +930,7 @@ void XmlDocVisitor::visitPre(DocImage *img) { baseName = correctURL(url,img->relPath()); } - visitPreStart(m_t, "image", FALSE, this, img->children(), baseName, TRUE, img->type(), img->width(), img->height(), img ->isInlineImage()); + visitPreStart(m_t, "image", FALSE, this, img->children(), baseName, TRUE, img->type(), img->width(), img->height(), img->attribs().find("alt"), img->isInlineImage()); // copy the image to the output dir FileDef *fd; |