Auto-Correcting Markup
See original GitHub issueI’m loving this tool, but had a quick question about the output.
I have:
<ul>
<li>a list item <li>with a weirdly nested list item</li> and more text afterwards</li>
</ul>
Which renders to:
<ul>
<li>a list item </li>
<li>with a weirdly nested list item</li> and more text afterwards
</ul>
I’m trying to catch poorly structured markup like this using $(“li > li”).addClass(“attn”) so that it can be reviewed and fixed manually. Unfortunately, this auto-correction actually obscures the error and makes it harder to find.
Is this intentional behaviour?
Issue Analytics
- State:
- Created 9 years ago
- Reactions:1
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Formatting Autocorrect Entries - Legal Office Guru
My advice is to select the text using your keyboard. Place your cursor before the first character, press and hold the Shift key,...
Read more >How to Use Autocorrect in Google Docs - Zapier
Google Docs offers an autocorrect feature: It's called Automatic ... Fix common misspellings, add markup, or create a text expander.
Read more >MICROSOFT WORD AUTO CORRECT AUTO FORMAT
Microsoft Word Tips, Tricks and Shortcuts Video Series!All steps have been tested in Word 2007, 2010, 2013 and 2016.
Read more >Auto Correct Auto Text - YouTube
We make legal formatting in MS Word easy to do for lawyers, legal secretaries, and paralegals. Through Kwik Docs, our legal macro package, ......
Read more >How to Use Microsoft Word AutoCorrect - ProofreadingPal
AutoFormat applies a predetermined set of formatting changes to an already-completed document with the click of single button, which is helpful ...
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
Hi @wahengchang if you are experiencing some kind of problem, it looks like a different issue.
Whereas the OP was hoping for a way to turn off Cheerio’s “auto-fixing” behavior that corrects invalid markup, your markup is already perfectly valid - I double checked by reading the spec and trying it in the W3C validator, just to be sure.
What problem are you having exactly? You should probably open a new issue for it, since this one is closed and therefor won’t receive much attention.
I understand I’m not the typical user. There probably aren’t many people using this for updating static HTML files from an LMS to comply with a11y.
This just struck me as a potential issue due to the loss of fidelity. There seems to be quite a bit of confusion surrounding nested lists, for instance, some people can’t decide between this:
this,
or this.
This type of error is common when Word docs are converted to HTML. Another similar issue with Word docs is stuff that looks like this:
The nature of my work is finding and fixing markup. Reality is, garbage in, garbage out is all part of the job. A manual inspection is required regardless, so for me it’s not it’s not the biggest deal.
Overall, I’m quite happy with the utility of Cheerio and think it’s a great tool for the job!
Cheers,
Mike