From 3f553a8e4266b24a67e5c7302ee81e1d5e648748 Mon Sep 17 00:00:00 2001 From: albert-github Date: Sat, 10 Aug 2019 17:33:33 +0200 Subject: Problem with '' In the docbook ouput this was shown with the attribute `nowrap>=''`, in HTML this empty tag was skipped. Normally a HTML attribute will have a value but in some cases it is possible without attribute and when this is the last attribute the `>` was accidently added to the attribute (in case of the value the `>` was already considered). Furthermore `In XHTML, attribute minimization is forbidden, and the nowrap attribute must be defined as .`, this is now handled for HTML and docbook as well. --- src/docbookvisitor.cpp | 4 ++++ src/doctokenizer.l | 2 +- src/htmldocvisitor.cpp | 6 ++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/docbookvisitor.cpp b/src/docbookvisitor.cpp index a42a895..ce3a845 100644 --- a/src/docbookvisitor.cpp +++ b/src/docbookvisitor.cpp @@ -1105,6 +1105,10 @@ DB_VIS_C { // just skip it } + else if (opt->name=="nowrap" && opt->value.isEmpty()) + { + m_t << " " << opt->name << "='nowrap'"; + } else { m_t << " " << opt->name << "='" << opt->value << "'"; diff --git a/src/doctokenizer.l b/src/doctokenizer.l index 194327c..79c7d0e 100644 --- a/src/doctokenizer.l +++ b/src/doctokenizer.l @@ -222,7 +222,7 @@ static void handleHtmlTag() } startName=i; // search for end of name - while (i<(int)yyleng && !isspace((uchar)c) && c!='=') { c=tagText.at(++i); } + while (i<(int)yyleng && !isspace((uchar)c) && c!='=' && c!= '>') { c=tagText.at(++i); } endName=i; HtmlAttrib opt; opt.name = tagText.mid(startName,endName-startName).lower(); diff --git a/src/htmldocvisitor.cpp b/src/htmldocvisitor.cpp index e1ff3e9..c7fcaf8 100644 --- a/src/htmldocvisitor.cpp +++ b/src/htmldocvisitor.cpp @@ -263,6 +263,12 @@ static QCString htmlAttribsToString(const HtmlAttribList &attribs, QCString *pAl result+="=\""+convertToXML(att->value)+"\""; } } + else if (att->name=="nowrap") // In XHTML, attribute minimization is forbidden, and the nowrap attribute must be defined as . + { + result+=" "; + result+=att->name; + result+="=\"nowrap\""; + } } return result; } -- cgit v0.12