Commit Graph

17 Commits (952bc0cc039c034c5fe651864db528dcd9800e9e)

Author SHA1 Message Date
Ika 952bc0cc03
fix: get rid of CRLF (#5494) 2018-12-08 18:28:29 +08:00
Ika cd28c22dbe
feat(html): smart quote for attributes (#5590) 2018-12-05 11:15:09 +08:00
Ika 7da4ed76ad
fix(html): do not touch comments (#5525) 2018-11-23 21:25:58 +08:00
Ika b2eadd234b
fix(vue): preserve custom block (#5458) 2018-11-23 12:33:48 +08:00
Ika 4f63be05e8
fix(html): leading space for leading interpolation in textarea is sensitive (#5468) 2018-11-15 10:34:42 +08:00
Ika 182a92eb28
fix(html): preserve incomplete ie conditional comment (#5429) 2018-11-10 16:44:44 +08:00
Ika 1bce579f8d
fix(ng|vue): whitespaces between interpolation and text are sensitive (#5396) 2018-11-10 01:00:26 +08:00
Ika de11f69889
fix(html): preserve unterminated ie conditional comments (#5424) 2018-11-09 23:26:59 +08:00
Ika 6f6b634948
fix(html): preserve content for `<template>` with unknown lang (#5388) 2018-11-09 19:19:03 +08:00
Ika 9acb02997a
feat(html): treat capital element as custom element (#5395)
Custom element: keep it on its own line if both leading/trailing line breaks exist
2018-11-09 09:51:31 +08:00
Ika 0228863a92
feat(html): handle pre with interpolation (#5400) 2018-11-09 09:50:57 +08:00
Ika 514b6d3741 Bump Prettier dependency to 1.15.0 2018-11-07 09:12:25 +08:00
Ika 5e8a4a115a
feat: support HTML/Vue/Angular (#5259) 2018-11-04 23:03:07 +08:00
Ika dd4687e7ef
feat(html): whitespace-sensitive formatting (#5168)
- whitespace-sensitive formatting 
  - respect css `display: block`/`white-space: pre` (data from [`html-styles`](https://github.com/marionebl/html-styles))
  - support magic comment (`<!-- display: block -->`)
  - add an option to specify whitespace sensitivity (`--html-whitespace-sensitivity <css|strict|ignore>`)
    - magic comments take precedence
    - (default) `css`: respect default css style (safe in the most cases)
    - `strict`: every node is considered whitespace sensitive (the safest)
    - `ignore`: every node is considered whitespace insensitive (dangerous, the original behavior)
  - inline inline-tags 
- support ie conditional comment (`<!--[if IE]><![endif]-->`)
- indent the script/style content
- no inconsistent output for 2+ attributes
- force break tag if there're multiline attributes
2018-10-13 13:55:38 +08:00
Ika 07abf0588e
fix(html): non-HTML attributes are considered case-sensitive (#5135) 2018-09-27 20:18:00 +08:00
Ika 13147facc5
feat(html): switch to htmlparser2 (#5127)
- switch to [`htmlparser2`](https://github.com/fb55/htmlparser2)
  - no need to fork
  - won't generate pseudo nodes ([`parse5` will](https://github.com/prettier/prettier/issues/5098#issuecomment-423055181))
  - should be [faster](https://github.com/fb55/htmlparser2#performance)
- support custom self-closing tags
- support HTML entities
- remove extra trailing newline for `<template>`
- distinguish empty/empty-string attributes (`<tag x>`/`<tag x="">`)
- rename `--parser parse5` with `--parser html`
- enable `html` since 1.15, which means it's enabled by default if you install the dev version from GitHub after this PR merged.
2018-09-22 21:53:38 +08:00
Ika ebedd5b74a
refactor(html): simplify/extract code (#5112)
- extract utilities
- use built-in hasPrettierIgnore
- simplify some functions
- remove dead code
2018-09-19 23:07:27 +08:00