HTML Formatter
Beautifies HTML with consistent indentation, including inline CSS and JavaScript.
Convert HTML markup into a YAML outline of its elements, attributes, and text. It is handy for extracting content, writing test fixtures, or reviewing a page's structure.
.html file.converted.yaml.The markup is parsed by your browser's own HTML parser, the one it uses to show web pages, so unclosed tags and missing quotes are repaired the same way a browser would. Nothing is rendered and no scripts run.
<html>) is converted from the html element. A fragment is converted from the elements you pasted.'@name' keys. Text is trimmed, and text next to child elements goes under '#text'.Input:
<nav class="menu"> <a href="/">Home</a> <a href="/about">About</a> </nav>
Output:
nav:
'@class': menu
a:
- '@href': /
'#text': Home
- '@href': /about
'#text': About
<h2> and <p> is lost.<b> in a sentence, becomes separate keys, which splits the sentence.<script> and <style> are kept as plain text.No. The browser's parser fixes unclosed tags and other common mistakes before converting, just as it does when it displays a page.
No. The markup is parsed into an inactive document that is never displayed, so scripts, images, and styles are not loaded or run.
Not exactly, because the order between different tags isn't kept. Use the YAML to XML converter to get XHTML-style markup back when order doesn't matter.
No. It is converted in your browser.
Often used together with the HTML to YAML Converter.
Beautifies HTML with consistent indentation, including inline CSS and JavaScript.
Converts XML into readable YAML, keeping attributes and repeated elements.
HTML to clean plain text, with lists and links kept.