SectionOnPage leaving newlines and escaping leading space in HREFs
See original GitHub issueSummary
Runnig VNU validator I noticed a few complaints for newlines in the generated HREFs. EX:
"file:/mnt/z/mdn-content/build/en-us/docs/web/api/htmlimageelement/loading/index.html":116.7-117.29: error: Bad value “/en-US/docs/Learn/HTML/Howto/Author_fast-loading_HTML_pages#use↩____lazy_loading_for_images” for attribute “href” on element “a”: Tab, new line or carriage return found.
Think the newlines should be stripped when generating the ID values.
URL
Reproduction steps
Expected behavior
Should generate:
<li><a href="/en-US/docs/Learn/HTML/Howto/Author_fast-loading_HTML_pages#use____lazy_loading_for_images">Use
lazy loading for images</a> in <a href="/en-US/docs/Learn/HTML/Howto/Author_fast-loading_HTML_pages">Tips for authoring fast-loading HTML pages</a></li>
Actual behavior
Generates:
<li><a href="/en-US/docs/Learn/HTML/Howto/Author_fast-loading_HTML_pages#use
____lazy_loading_for_images">Use
lazy loading for images</a> in <a href="/en-US/docs/Learn/HTML/Howto/Author_fast-loading_HTML_pages">Tips for authoring fast-loading HTML pages</a></li>
Device
Desktop
Browser
Firefox
Browser version
Stable
Operating system
Windows
Screenshot
No response
Anything else?
The browser ultimately “fixes” this, so it doesn’t fail to render the link
Validations
- I have read the Community Participation Guidelines.
- I have verified that there isn’t already an issue that reports the same bug to avoid creating a duplicate.
- I have checked that this is a concrete bug. For Q&A open a GitHub Discussion.
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:11 (7 by maintainers)
Top Results From Across the Web
Render a string in HTML and preserve spaces and linebreaks
<div> This is some text with some extra spacing and a few newlines along with some trailing spaces and five leading spaces thrown...
Read more >UNIX System Services Programming Tools - IBM
If a newline character is found, yylex() increments the count of lines and characters. If a sequence of spaces or tabs is found,...
Read more >Greenbook Manual (Full) - PGE
space on the property for PG&E to install a dedicated transformer. ... enter from the top without interfering with the utility-provided manual bypass...
Read more >Removing whitespace from around links? - HTML & CSS
Hi there, Sometimes when I have links on new lines, it is adding a space/whitespace after the link. For example, if I have:...
Read more >Jinja2 Tutorial - Part 3 - Whitespace control |
You should now clearly see leading spaces that were left by Jinja2 block on three of the lines, as well as all of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If this is just being tracked under the regular depreciation, I guess this could just be closed
It looks like
SectionOnPage
is still used in mdn/content, which is probably why it’s not marked as deprecated yet.cc @bsmth