diff options
author | Topi Reinio <topi.reinio@qt.io> | 2019-05-06 12:31:08 +0200 |
---|---|---|
committer | Topi Reinio <topi.reinio@qt.io> | 2019-05-06 12:36:56 +0200 |
commit | b22049ea14b62a2a743fd5fbd23563c566ef528a (patch) | |
tree | 1f514849da723b139701c8003db4ceed2e9cae02 | |
parent | 1e2671435fb828f088e6ca034a8724991907389f (diff) |
qdoc: Add id attribute for all HTML headings
The HTML generator only added an id tag for h2 (\section1) headings
for unknown reasons. \section2 and up relied on the obsolete method
of using <a name="..."> anchors for the section headings.
Remove this restriction to make the output more consistent.
Change-Id: I577d62cf59cefd199224dacf29ced61518b4b7fc
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Martin Smith <martin.smith@qt.io>
-rw-r--r-- | src/qdoc/htmlgenerator.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/qdoc/htmlgenerator.cpp b/src/qdoc/htmlgenerator.cpp index 39ac26445..23cd581e6 100644 --- a/src/qdoc/htmlgenerator.cpp +++ b/src/qdoc/htmlgenerator.cpp @@ -1157,11 +1157,8 @@ int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMark break; case Atom::SectionHeadingLeft: { int unit = atom->string().toInt() + hOffset(relative); - out() << "<h" + QString::number(unit) + QLatin1Char(' '); - if (unit < 3) { - out() << "id=\"" << Doc::canonicalTitle(Text::sectionHeading(atom).toString()) << "\""; - } - out() << '>'; + out() << "<h" + QString::number(unit) + QLatin1Char(' ') + << "id=\"" << Doc::canonicalTitle(Text::sectionHeading(atom).toString()) << "\">"; inSectionHeading_ = true; break; } |