ietf-tools / xml2rfc

Generate RFCs and IETF drafts from document source in XML according to the IETF xml2rfc v2 and v3 vocabularies
https://ietf-tools.github.io/xml2rfc/
BSD 3-Clause "New" or "Revised" License
69 stars 38 forks source link

HTML contains two <h1> elements #428

Closed ietf-svn-bot closed 4 years ago

ietf-svn-bot commented 5 years ago

owner:mark@painless-security.com resolution_fixed type_defect | by julian.reschke@gmx.de


This may be allowed by the W3 validor, but is incorrect with respect to the element definition:

https://html.spec.whatwg.org/multipage/sections.html#headings-and-sections:

"The first element of heading content in an element of sectioning content represents the heading for that section. Subsequent headings of equal or higher rank start new (implied) sections...."

The second instance of

arguably does not start a new section, so it is incorrect to use it that way.


Issue migrated from trac:428 at 2022-02-05 12:50:09 +0000

ietf-svn-bot commented 5 years ago

@julian.reschke@gmx.de changed title from HTML containt two <h1> elements to HTML contains two <h1> elements

ietf-svn-bot commented 4 years ago

@henrik@levkowetz.com _changed component from Version_3_cli_html to v3 vocabulary, v2 xml2rfc_

ietf-svn-bot commented 4 years ago

@rjsparks@nostrum.com changed status from new to accepted

ietf-svn-bot commented 4 years ago

@mark@painless-security.com changed status from accepted to assigned

ietf-svn-bot commented 4 years ago

@mark@painless-security.com changed owner from ` tomark@painless-security.com`

ietf-svn-bot commented 4 years ago

@mark@painless-security.com commented


I see multiple

lines for the RFC number immediately followed by the RFC title, just after the authorship section. There are two obvious ways to reduce these elements down to a single

element. First, the two elements could have their content combined into a single element, or, second, one of the elements could be converted into something other than

.

If you want to combine them, would you like to keep the same formatting or would you like to convert it to something like "RFC ####: Title Title Title"?

If you want to convert one of them into something other than a heading element, which information should be the heading, the title or the RFC number?

ietf-svn-bot commented 4 years ago

@henrik@levkowetz.com commented


The formatting (the visual representation) should stay the same; it's been agreed with the RFC Editor during discussion on including the RFC number ahead of the subject title at this point in the document.

I think we should combine the two, and give the rfcnum a and the title a . This leads to a need to adjust the CSS. When doing so, please add corrections at the end of xml2rfc/data/xml2rfc.css (Doing so has facilitated communication about the style with the style designer that did the original CSS work, when his input has been needed).

I think the needed adjustment at the end of xml2rfc.css would be:

/* Adapt to only one h1 element */
h1 {
  clear: both;
  border-bottom: 1px solid #ddd;
  margin: 0 0 0.5em 0;
  padding: 1em 0 0.5em;
}
#title {
  clear: none;
  border-bottom: 0 none #fff;
}

The alternative style sheet xml2rfc/data/mt.css will also need adjustment, but in this case we don't have the same need to keep the original CSS untouched, so updating the #title entry to instead select on h1 should suffice.

ietf-svn-bot commented 4 years ago

@mark@painless-security.com commented


Are there any existing tests that cover HTML output for the full RFC? I cannot find any, and I cannot generate a test failure even if I replace tests/valid/rfc7911.v3.py37.html with an empty file.

ietf-svn-bot commented 4 years ago

@mark@painless-security.com changed status from assigned to closed

ietf-svn-bot commented 4 years ago

@mark@painless-security.com changed resolution from ` tofixed`

ietf-svn-bot commented 4 years ago

@mark@painless-security.com commented


Fixed in c803ea49b6c4d17baf46b1aa448e799b362bd11a:

Generate only one

element, and update CSS files to cope with this change. Fixes #428

ietf-svn-bot commented 4 years ago

@julian.reschke@gmx.de commented


Hm.

Tools that extract the title will now see "RFC nnnn" and the title concatenated together, no? (because they will ignore and not look a the CSS). Minimally, there should be whitespace separating these.

ietf-svn-bot commented 4 years ago

@mark@painless-security.com commented


Fixed in 707616517becca0304e3e07e8b84e22e797e1adb:

Add line breaks and spaces to the HTML output, for better downstream parsing. Fixes #428