diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2019-03-10 18:16:51 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-10 18:16:51 (GMT) |
commit | 99a6b3dfd10e239fd7723439c82124b82b537a67 (patch) | |
tree | 804f298b370243d96c7489a4263ebea8242bf961 /src | |
parent | 0cacf4e6cdf4c4fd895b92e351d55b0f16472186 (diff) | |
parent | a735007427439b73327af0c8cfa003423bcdef6e (diff) | |
download | Doxygen-99a6b3dfd10e239fd7723439c82124b82b537a67.zip Doxygen-99a6b3dfd10e239fd7723439c82124b82b537a67.tar.gz Doxygen-99a6b3dfd10e239fd7723439c82124b82b537a67.tar.bz2 |
Merge pull request #6861 from albert-github/feature/bug_html_attributes
Multiple use of HTML attributes
Diffstat (limited to 'src')
-rw-r--r-- | src/htmldocvisitor.cpp | 42 |
1 files changed, 40 insertions, 2 deletions
diff --git a/src/htmldocvisitor.cpp b/src/htmldocvisitor.cpp index 9bd0b4f..37f6bd0 100644 --- a/src/htmldocvisitor.cpp +++ b/src/htmldocvisitor.cpp @@ -211,6 +211,34 @@ static bool isInvisibleNode(DocNode *node) ; } +static void mergeHtmlAttributes(const HtmlAttribList &attribs, HtmlAttribList *mergeInto) +{ + HtmlAttribListIterator li(attribs); + HtmlAttrib *att; + for (li.toFirst();(att=li.current());++li) + { + HtmlAttribListIterator ml(*mergeInto); + HtmlAttrib *opt; + bool found = false; + for (ml.toFirst();(opt=ml.current());++ml) + { + if (opt->name == att -> name) + { + found = true; + break; + } + } + if (found) + { + opt->value = opt->value + " " + att->value; + } + else + { + mergeInto->append(att); + } + } +} + static QCString htmlAttribsToString(const HtmlAttribList &attribs, QCString *pAltValue = 0) { QCString result; @@ -1660,8 +1688,18 @@ void HtmlDocVisitor::visitPre(DocImage *img) sizeAttribs+=" height=\""+img->height()+"\""; } // 16 cases: url.isEmpty() | typeSVG | inlineImage | img->hasCaption() + + HtmlAttribList extraAttribs; + if (typeSVG) + { + HtmlAttrib opt; + opt.name = "style"; + opt.value = "pointer-events: none;"; + extraAttribs.append(&opt); + } QCString alt; - QCString attrs = htmlAttribsToString(img->attribs(),&alt); + mergeHtmlAttributes(img->attribs(),&extraAttribs); + QCString attrs = htmlAttribsToString(extraAttribs,&alt); QCString src; if (url.isEmpty()) { @@ -1673,7 +1711,7 @@ void HtmlDocVisitor::visitPre(DocImage *img) } if (typeSVG) { - m_t << "<object type=\"image/svg+xml\" style=\"pointer-events: none;\" data=\"" << src + m_t << "<object type=\"image/svg+xml\" data=\"" << src << "\"" << sizeAttribs << attrs; if (inlineImage) { |