├── packages ├── webparser │ ├── .npmignore │ ├── src │ │ ├── public_api.ts │ │ ├── interpolation_config.ts │ │ ├── html_parser.ts │ │ ├── assertions.ts │ │ ├── ast_path.ts │ │ ├── chars.ts │ │ └── ast_spec_utils.ts │ ├── jest.config.js │ ├── tsconfig.json │ ├── tslint.json │ ├── package.json │ ├── LICENSE │ └── README.md ├── prettyhtml-hast-to-html │ ├── index.js │ ├── lib │ │ ├── omission │ │ │ ├── index.js │ │ │ ├── util │ │ │ │ ├── place.js │ │ │ │ ├── first.js │ │ │ │ ├── white-space-left.js │ │ │ │ └── siblings.js │ │ │ ├── omission.js │ │ │ └── opening.js │ │ ├── raw.js │ │ ├── comment.js │ │ ├── text.js │ │ ├── doctype.js │ │ ├── one.js │ │ ├── all.js │ │ ├── constants.js │ │ └── index.js │ ├── test │ │ ├── omission-opening.js │ │ ├── index.js │ │ ├── root.js │ │ ├── core.js │ │ ├── comment.js │ │ ├── raw.js │ │ ├── omission-closing-tr.js │ │ ├── omission-closing-tfoot.js │ │ ├── omission-opening-html.js │ │ ├── omission-closing-body.js │ │ ├── omission-closing-html.js │ │ ├── omission-closing.js │ │ ├── omission-closing-li.js │ │ ├── text.js │ │ ├── omission-closing-optgroup.js │ │ ├── omission-opening-tbody.js │ │ ├── omission-closing-head.js │ │ ├── omission-closing-dd.js │ │ ├── omission-closing-dt.js │ │ ├── omission.js │ │ ├── omission-closing-tbody.js │ │ ├── element.js │ │ ├── omission-closing-colgroup.js │ │ ├── omission-closing-option.js │ │ ├── omission-closing-thead.js │ │ ├── omission-opening-head.js │ │ ├── omission-closing-caption.js │ │ ├── omission-closing-td-th.js │ │ ├── omission-opening-colgroup.js │ │ ├── omission-closing-rp-rt.js │ │ ├── omission-opening-body.js │ │ ├── omission-closing-menuitem.js │ │ └── omission-closing-p.js │ ├── README.md │ ├── LICENSE │ └── package.json ├── prettyhtml-formatter │ ├── test │ │ ├── fixtures │ │ │ ├── indent-number │ │ │ │ ├── config.json │ │ │ │ ├── input.html │ │ │ │ └── output.html │ │ │ ├── indent-tabs │ │ │ │ ├── config.json │ │ │ │ ├── input.html │ │ │ │ └── output.html │ │ │ ├── attribute-known-incasesensitive │ │ │ │ ├── input.html │ │ │ │ └── output.html │ │ │ ├── print-width-tabs │ │ │ │ ├── config.json │ │ │ │ ├── input.html │ │ │ │ └── output.html │ │ │ ├── indent-initial-false │ │ │ │ ├── input.html │ │ │ │ ├── config.json │ │ │ │ └── output.html │ │ │ ├── print-width-custom │ │ │ │ ├── config.json │ │ │ │ ├── input.html │ │ │ │ └── output.html │ │ │ ├── print-width-nested-tabs │ │ │ │ ├── config.json │ │ │ │ ├── input.html │ │ │ │ └── output.html │ │ │ ├── script-no-prettier │ │ │ │ ├── config.json │ │ │ │ ├── output.html │ │ │ │ └── input.html │ │ │ ├── style-no-prettier │ │ │ │ ├── config.json │ │ │ │ ├── output.html │ │ │ │ └── input.html │ │ │ ├── attribute-single-quotes │ │ │ │ ├── config.json │ │ │ │ ├── input.html │ │ │ │ └── output.html │ │ │ ├── case-sensitive-void-elements │ │ │ │ ├── input.html │ │ │ │ └── output.html │ │ │ ├── attribute-no-quotes │ │ │ │ ├── input.html │ │ │ │ └── output.html │ │ │ ├── camelCase-tags │ │ │ │ ├── input.html │ │ │ │ └── output.html │ │ │ ├── doctype │ │ │ │ ├── input.html │ │ │ │ └── output.html │ │ │ ├── force-attribute-wrapping │ │ │ │ ├── config.json │ │ │ │ ├── input.html │ │ │ │ └── output.html │ │ │ ├── custom-void-elements │ │ │ │ ├── input.html │ │ │ │ └── output.html │ │ │ ├── preserve-boolean-attributes │ │ │ │ ├── output.html │ │ │ │ └── input.html │ │ │ ├── attribute-casesensitive │ │ │ │ ├── output.html │ │ │ │ └── input.html │ │ │ ├── auto-close-tags │ │ │ │ ├── input.html │ │ │ │ └── output.html │ │ │ ├── entity-encoding │ │ │ │ ├── input.html │ │ │ │ └── output.html │ │ │ ├── void │ │ │ │ ├── input.html │ │ │ │ └── output.html │ │ │ ├── indent-default │ │ │ │ ├── input.html │ │ │ │ └── output.html │ │ │ ├── self-closing-elements │ │ │ │ ├── input.html │ │ │ │ └── output.html │ │ │ ├── indent-initial-default │ │ │ │ ├── input.html │ │ │ │ └── output.html │ │ │ ├── table-foster-parenting │ │ │ │ ├── input.html │ │ │ │ └── output.html │ │ │ ├── tag-casesensitive │ │ │ │ ├── input.html │ │ │ │ └── output.html │ │ │ ├── white-space-void │ │ │ │ ├── input.html │ │ │ │ └── output.html │ │ │ ├── attribute-quoting │ │ │ │ ├── output.html │ │ │ │ └── input.html │ │ │ ├── attribute-character-references │ │ │ │ ├── input.html │ │ │ │ └── output.html │ │ │ ├── comments-elements │ │ │ │ ├── output.html │ │ │ │ └── input.html │ │ │ ├── image-tag │ │ │ │ ├── input.html │ │ │ │ └── output.html │ │ │ ├── style │ │ │ │ ├── output.html │ │ │ │ └── input.html │ │ │ ├── print-width-void │ │ │ │ ├── input.html │ │ │ │ └── output.html │ │ │ ├── structural-directives-vue │ │ │ │ ├── output.html │ │ │ │ └── input.html │ │ │ ├── style-different-type │ │ │ │ ├── input.html │ │ │ │ └── output.html │ │ │ ├── print-width-nested │ │ │ │ ├── input.html │ │ │ │ └── output.html │ │ │ ├── print-width-self-closing │ │ │ │ ├── input.html │ │ │ │ └── output.html │ │ │ ├── print-width │ │ │ │ ├── input.html │ │ │ │ └── output.html │ │ │ ├── structural-directives-angular │ │ │ │ ├── output.html │ │ │ │ └── input.html │ │ │ ├── template-expressions-vue │ │ │ │ ├── output.html │ │ │ │ └── input.html │ │ │ ├── preserve-whitespace-flag │ │ │ │ ├── output.html │ │ │ │ └── input.html │ │ │ ├── issue-74-white-space │ │ │ │ ├── input.html │ │ │ │ └── output.html │ │ │ ├── parent-insertion │ │ │ │ ├── output.html │ │ │ │ └── input.html │ │ │ ├── preserve-explicit-namespace │ │ │ │ ├── input.html │ │ │ │ └── output.html │ │ │ ├── attribute-encoding │ │ │ │ ├── input.html │ │ │ │ └── output.html │ │ │ ├── nested-templates │ │ │ │ ├── input.html │ │ │ │ └── output.html │ │ │ ├── mixed-documents │ │ │ │ ├── output.html │ │ │ │ └── input.html │ │ │ ├── template-expressions-angular │ │ │ │ ├── input.html │ │ │ │ └── output.html │ │ │ ├── gaps-preservation │ │ │ │ ├── output.html │ │ │ │ └── input.html │ │ │ ├── indent-multiline-text │ │ │ │ ├── output.html │ │ │ │ └── input.html │ │ │ ├── prettier-embedded │ │ │ │ ├── output.html │ │ │ │ └── input.html │ │ │ ├── comments │ │ │ │ ├── input.html │ │ │ │ └── output.html │ │ │ ├── issue-79-gaps-preservation │ │ │ │ ├── output.html │ │ │ │ └── input.html │ │ │ ├── print-width-with-inner-text │ │ │ │ ├── input.html │ │ │ │ └── output.html │ │ │ ├── comments-conditional │ │ │ │ ├── input.html │ │ │ │ └── output.html │ │ │ ├── template-expressions-svelte │ │ │ │ ├── input.html │ │ │ │ └── output.html │ │ │ ├── whitespace-leading-text │ │ │ │ ├── input.html │ │ │ │ └── output.html │ │ │ ├── script-nested │ │ │ │ ├── output.html │ │ │ │ └── input.html │ │ │ ├── ignore-flag │ │ │ │ ├── input.html │ │ │ │ └── output.html │ │ │ ├── example │ │ │ │ ├── input.html │ │ │ │ └── output.html │ │ │ ├── vue │ │ │ │ ├── input.html │ │ │ │ └── output.html │ │ │ ├── issue-65-white-space │ │ │ │ ├── input.html │ │ │ │ └── output.html │ │ │ ├── soft-table-handling │ │ │ │ ├── output.html │ │ │ │ └── input.html │ │ │ ├── preserve-attribute-wrapping-flag │ │ │ │ ├── input.html │ │ │ │ └── output.html │ │ │ ├── white-space │ │ │ │ ├── input.html │ │ │ │ └── output.html │ │ │ ├── attribute-boolean │ │ │ │ ├── input.html │ │ │ │ └── output.html │ │ │ └── html5-boilerplate │ │ │ │ ├── input.html │ │ │ │ └── output.html │ │ └── index.js │ ├── stringify.js │ ├── README.md │ ├── LICENSE │ └── package.json ├── prettyhtml-hastscript │ ├── index.js │ ├── .editorconfig │ ├── svg.js │ ├── html.js │ ├── README.md │ ├── LICENSE │ └── package.json ├── prettyhtml │ ├── test │ │ ├── snapshots │ │ │ ├── api.js.snap │ │ │ ├── cli.js.snap │ │ │ ├── api.js.md │ │ │ └── cli.js.md │ │ └── api.js │ ├── README.md │ ├── test-helpers │ │ ├── prepareVfile.js │ │ └── util.js │ ├── LICENSE │ ├── index.js │ ├── package.json │ └── cli │ │ ├── processor.js │ │ ├── index.js │ │ └── args.js ├── expression-parser │ ├── test │ │ ├── snapshots │ │ │ └── index.js.snap │ │ └── index.js │ ├── package.json │ └── README.md ├── rehype-webparser │ ├── test │ │ └── index.test.ts │ ├── tsconfig.json │ ├── jest.config.js │ ├── tslint.json │ ├── LICENSE │ ├── package.json │ └── README.md ├── prettyhtml-sort-attributes │ ├── README.md │ ├── index.js │ ├── package.json │ └── test.js ├── hast-util-from-webparser │ ├── tsconfig.json │ ├── jest.config.js │ ├── tslint.json │ ├── LICENSE │ ├── package.json │ └── README.md ├── rehype-minify-whitespace │ ├── list.js │ ├── README.md │ ├── LICENSE │ ├── package.json │ └── test.js └── prettyhtml-quick │ ├── package.json │ ├── LICENSE │ ├── README.md │ ├── lib │ └── git.js │ └── bin │ └── cli.js ├── logo.png ├── .eslintrc.json ├── .gitattributes ├── .prettierrc ├── .prettierignore ├── lerna.json ├── azure-pipelines.yml ├── .github ├── ISSUE_TEMPLATE.md ├── ISSUE_TEMPLATE │ ├── feature.md │ ├── question.md │ ├── bug.md │ └── regression.md └── stale.yml ├── .eslintignore ├── examples └── simple.js ├── .editorconfig ├── azure-pipelines-template.yml ├── LICENSE ├── .gitignore └── package.json /packages/webparser/.npmignore: -------------------------------------------------------------------------------- 1 | coverage 2 | -------------------------------------------------------------------------------- /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Prettyhtml/prettyhtml/HEAD/logo.png -------------------------------------------------------------------------------- /packages/prettyhtml-hast-to-html/index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | module.exports = require('./lib') 3 | -------------------------------------------------------------------------------- /packages/prettyhtml-formatter/test/fixtures/indent-number/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "tabWidth": 4 3 | } 4 | -------------------------------------------------------------------------------- /packages/prettyhtml-formatter/test/fixtures/indent-tabs/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "useTabs": true 3 | } 4 | -------------------------------------------------------------------------------- /packages/prettyhtml-hastscript/index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | module.exports = require('./html') 4 | -------------------------------------------------------------------------------- /packages/prettyhtml-formatter/test/fixtures/attribute-known-incasesensitive/input.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /packages/prettyhtml-formatter/test/fixtures/indent-number/input.html: -------------------------------------------------------------------------------- 1 |

Foo 2 | bar

3 | -------------------------------------------------------------------------------- /packages/prettyhtml-formatter/test/fixtures/indent-tabs/input.html: -------------------------------------------------------------------------------- 1 |

Foo 2 | bar

3 | -------------------------------------------------------------------------------- /packages/prettyhtml-formatter/test/fixtures/print-width-tabs/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "useTabs": true 3 | } 4 | -------------------------------------------------------------------------------- /packages/prettyhtml-formatter/test/fixtures/attribute-known-incasesensitive/output.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /packages/prettyhtml-formatter/test/fixtures/indent-initial-false/input.html: -------------------------------------------------------------------------------- 1 |
2 |

Bar

3 |
4 | -------------------------------------------------------------------------------- /packages/prettyhtml-formatter/test/fixtures/print-width-custom/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 120 3 | } 4 | -------------------------------------------------------------------------------- /packages/prettyhtml-formatter/test/fixtures/print-width-nested-tabs/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "useTabs": true 3 | } 4 | -------------------------------------------------------------------------------- /packages/prettyhtml-formatter/test/fixtures/script-no-prettier/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "usePrettier": false 3 | } 4 | -------------------------------------------------------------------------------- /packages/prettyhtml-formatter/test/fixtures/style-no-prettier/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "usePrettier": false 3 | } 4 | -------------------------------------------------------------------------------- /packages/prettyhtml-formatter/test/fixtures/attribute-single-quotes/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true 3 | } 4 | -------------------------------------------------------------------------------- /packages/prettyhtml-formatter/test/fixtures/case-sensitive-void-elements/input.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /packages/prettyhtml-formatter/test/fixtures/indent-initial-false/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "indentInitial": false 3 | } 4 | -------------------------------------------------------------------------------- /packages/prettyhtml-formatter/test/fixtures/indent-initial-false/output.html: -------------------------------------------------------------------------------- 1 |
2 |

Bar

3 |
4 | -------------------------------------------------------------------------------- /packages/prettyhtml-formatter/test/fixtures/attribute-no-quotes/input.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /packages/prettyhtml-formatter/test/fixtures/camelCase-tags/input.html: -------------------------------------------------------------------------------- 1 | This is valid. 2 | -------------------------------------------------------------------------------- /packages/prettyhtml-formatter/test/fixtures/doctype/input.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /packages/prettyhtml-formatter/test/fixtures/force-attribute-wrapping/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "wrapAttributes": true 3 | } 4 | -------------------------------------------------------------------------------- /packages/prettyhtml-formatter/test/fixtures/indent-tabs/output.html: -------------------------------------------------------------------------------- 1 |

2 | Foo 3 | bar 4 |

5 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "hemera", 3 | "globals": { 4 | "expect": true, 5 | "Code": true 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /packages/prettyhtml-formatter/test/fixtures/attribute-no-quotes/output.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /packages/prettyhtml-formatter/test/fixtures/camelCase-tags/output.html: -------------------------------------------------------------------------------- 1 | This is valid. 2 | -------------------------------------------------------------------------------- /packages/prettyhtml-formatter/test/fixtures/case-sensitive-void-elements/output.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /packages/prettyhtml-formatter/test/fixtures/custom-void-elements/input.html: -------------------------------------------------------------------------------- 1 | 2 |

3 | 4 |

5 | -------------------------------------------------------------------------------- /packages/prettyhtml-formatter/test/fixtures/doctype/output.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /packages/prettyhtml-formatter/test/fixtures/indent-number/output.html: -------------------------------------------------------------------------------- 1 |

2 | Foo 3 | bar 4 |

5 | -------------------------------------------------------------------------------- /packages/prettyhtml-formatter/test/fixtures/custom-void-elements/output.html: -------------------------------------------------------------------------------- 1 | 2 |

3 | 4 |

5 | -------------------------------------------------------------------------------- /packages/prettyhtml-formatter/test/fixtures/preserve-boolean-attributes/output.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /packages/prettyhtml-formatter/test/fixtures/attribute-casesensitive/output.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /packages/prettyhtml-formatter/test/fixtures/auto-close-tags/input.html: -------------------------------------------------------------------------------- 1 |
2 |

3 |
4 | 5 | 6 |
7 | -------------------------------------------------------------------------------- /packages/prettyhtml-formatter/test/fixtures/entity-encoding/input.html: -------------------------------------------------------------------------------- 1 |
&
2 |
foo > bar
3 |
foo < bar
4 | -------------------------------------------------------------------------------- /packages/prettyhtml-formatter/test/fixtures/entity-encoding/output.html: -------------------------------------------------------------------------------- 1 |
&
2 |
foo > bar
3 |
foo < bar
4 | -------------------------------------------------------------------------------- /packages/prettyhtml-formatter/test/fixtures/preserve-boolean-attributes/input.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | -------------------------------------------------------------------------------- /packages/prettyhtml-formatter/test/fixtures/void/input.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /packages/prettyhtml-formatter/test/fixtures/attribute-casesensitive/input.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | -------------------------------------------------------------------------------- /packages/prettyhtml-formatter/test/fixtures/auto-close-tags/output.html: -------------------------------------------------------------------------------- 1 |
2 |

3 |
4 | 5 | 6 |
7 | -------------------------------------------------------------------------------- /packages/prettyhtml-formatter/test/fixtures/void/output.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Set the default behavior, in case people don't have core.autocrlf set. 2 | * text=auto 3 | *.html text eol=lf 4 | *.htm text eol=lf -------------------------------------------------------------------------------- /packages/prettyhtml-formatter/test/fixtures/indent-default/input.html: -------------------------------------------------------------------------------- 1 |

Foo 2 | bar 3 |

4 | Foo 5 | bar 6 | 7 | -------------------------------------------------------------------------------- /packages/prettyhtml/test/snapshots/api.js.snap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Prettyhtml/prettyhtml/HEAD/packages/prettyhtml/test/snapshots/api.js.snap -------------------------------------------------------------------------------- /packages/prettyhtml/test/snapshots/cli.js.snap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Prettyhtml/prettyhtml/HEAD/packages/prettyhtml/test/snapshots/cli.js.snap -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 110, 3 | "semi": false, 4 | "singleQuote": true, 5 | "trailingComma": "none", 6 | "bracketSpacing": true 7 | } 8 | -------------------------------------------------------------------------------- /packages/prettyhtml-formatter/test/fixtures/self-closing-elements/input.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 |