Commit Graph

25 Commits (master)

Author SHA1 Message Date
Ika 4af3dd4b07
test: improve snapshots (#5521)
- before
  ```
  ${input}${"~".repeat(printWidth)}
  ${output}
  ```
- after
  ```
  ===options===
  ${options}
  ${" ".repeat(printWidth)}| printWidth
  ====input====
  ${input}
  ===output====
  ${output}
  =============
  ```
2018-11-25 16:21:14 +08:00
Ika 556fb3e646
feat(markdown): only align lists if they're already aligned (#4893)
* feat(markdown): only align lists if they're already aligned

* fix: handle single item with multiple leading spaces

* fix: empty items are considered not aligned
2018-07-27 09:48:09 +08:00
Ika 1a2c4e663e
chore: use pre-release version number on master (#4855)
* chore: use pre-release version number on master

* docs: tweak comment
2018-07-18 09:38:26 +08:00
Simen Bekkhus 51b7c02e12 Upgrade jest to 22 (#4782)
* chore: upgrade Jest

* chore: update snapshots

* chore: lock down babel dependency using invalid syntax

* 2 args to test.skip

* use jest 22 for now

* Revert "2 args to test.skip"

This reverts commit 691fdc3f99e320f2303958f2b503f7b4c93fa455.

* remove snapshot name from matcher

* fix standalone tests skips
2018-07-03 03:06:29 -03:00
Ika c38e6af301
fix(yaml): add missing `since` field (#4739) 2018-06-23 17:04:47 +08:00
Ika dcf44ffbdc
feat: support YAML (#4563)
* feat: support YAML

* fix: do not indent sequence in mappingValue

* docs: add yaml to index.md

* fix: reduce `SyntaxError: Node#parse consumed no characters`

* chore: remove old-build and new-worker.js

* refactor

* refactor

* refactor

* refactor

* refactor

* refactor

* refactor

* refactor

* refactor

* refactor

* refactor

* refactor

* fix: no space after `<<`

* fix: add yaml to standalone test

* test: add tests

* fix: next empty line in flow collection

* fix: tabs are not allowed
http://yaml.org/spec/1.2/spec.html#space/indentation/

* fix: update parser

* feat: rewrite the mappingItem logic
* feat: indent sequence in mapping
* feat(doc): add ifBreak#groupId and group#id

* chore: fix node 4

* chore: add tools_yaml.svg

* chore: remove resolved TODO

* refactor: remove unnecessary workaround

* chore(worker): importScriptOnce

* chore(build): rename with babelPlugins

* make it rollup compatible

* feat: support singleQuote

* refactor
2018-06-21 10:29:42 +08:00
Jed Fox a1e8d586ad
Add a single test suite for blank files in all parsers (#4562)
* Add a single test suite for blank files in all parsers

The parsers that don’t yet support blank files have been filtered out of the list until they do.

* Don’t directly `require()` Prettier

* Update `require`

* Add missing Babylon parser

* Update snapshots
2018-05-27 08:22:25 -04:00
Ika 6447d30b0b
feat(markdown): change unordered list symbol to hyphen (#4440) 2018-05-10 14:32:52 +08:00
Huy Vo 2ad7576d3a Remove newline in empty .md files (#4388)
* Remove newline in empty .md files

* Fix cannot read property 'type' of undefined bug
2018-04-27 15:01:14 +08:00
Anthony Sottile a02094961a pre-commit.com is now served on https (#4088) 2018-03-02 07:26:36 -05:00
Ika c1107a86dd feat(markdown): respect tabWidth for list items (#3990)
* feat(markdown): respect tabWidth for list items

* test: ensure no regression for #3459
2018-02-24 19:13:02 +11:00
Lipis 7a7eb17082
fix: Proper case for Prettier, JavaScript, TypeScript, GitHub, Less (#3848) 2018-01-31 11:56:05 +01:00
Jed Fox 5ccc213a21 Conform the quotes in Markdown link titles to the singleQuote option (#3481)
* Add an option to utils.printString to use the passed string as-is

* Conform the quotes in Markdown link titles to the singleQuote option

* Don’t use destructuring

* Add some tests

* Format util.js

* Use custom string-printing logic

* Add some more tests

* Fix tests

* Address review comments

* Revert "Format util.js"

This reverts commit d2533ef7fb9231e2f733ece7decac9b923cf6941.

* Revert "Don’t use destructuring"

This reverts commit a5d3b0ac76a076e9a89cffc8cec396cabeacd1ee.

* Revert "Add an option to utils.printString to use the passed string as-is"

This reverts commit ef8e8322609ca3c2808885f3fadcd03f0790078c.

* Even more tests
2017-12-24 15:44:38 +01:00
Ika 073c0b16d8 feat(markdown): add `proseWrap: "preserve"` option (#3340)
* test: add test case

* feat(markdown): add `proseWrap: "preserve"` option

* test: add tests

* docs(options): update `proseWrap`

* feat(markdown): change default to `proseWrap: "preserve"`

BREAKING CHANGE

* docs(options): update `proseWrap`

* test: specify option explicitly

* Fix lint after merge

* Fix error after merge
2017-12-02 09:48:40 +11:00
Lucas Duailibe f119d4a90f
Change run_spec to have explicit parser list (#3356) 2017-11-30 03:31:52 -03:00
Ika 49f578fb91
fix(markdown): do not break `inlineCode` (#3230) 2017-11-11 12:50:40 +08:00
Ika 7fb8e3fe43 fix(markdown): no break on link (#3204)
* fix(markdown): link/image url head is breakable

* fix(markdown): no break on link
2017-11-09 08:19:35 +11:00
Lucas Duailibe a35257bacf Print JSON top comments as leading comments of root node (#3187)
* Make JSON top comments be leading comments of root node

* Update snapshot
2017-11-08 09:01:09 +11:00
Ika ec7eced099
test: lowercase the test file to avoid cross platform issue (#3189) 2017-11-07 22:07:01 +08:00
Ika ec8deb6c0b fix(markdown): print `---`-style thematic break (#3148)
* fix(markdown): print `---`-style thematic break

* test: fix diff
2017-11-05 20:50:10 +11:00
Ika 11d7213862 test(markdown): rename test case to avoid confusing (#3086) 2017-10-23 09:49:13 +08:00
Ika c3b965145b feat(markdown): auto-detect which number style of ordered list to be used (#3029) 2017-10-14 22:53:58 +11:00
Ika c4118edbe7 fix(markdown): print auto-link as-is (#3032) 2017-10-14 22:49:12 +11:00
Ika 5c789b2dfc fix(markdown): use the most popular unordered list style (#3027) 2017-10-14 22:41:25 +11:00
Ika 9f6f3e7355 feat: support markdown (#2943)
* feat(markdown): inital implementation

* feat(markdown): support strong

* fix: add missing default value

* feat(markdown): support inlineCode

* feat: support delete

* feat: support link

* feat: support image

* feat: support blockquote

* feat: support heading

* feat: support code

* feat: support yaml

* feat: support html

* feat: support list

* feat: support thematicBreak

* feat: support table

* feat: support linkReference

* feat: support imageReference

* feat: support definition

* feat: support footnote

* feat: support footnoteReference

* feat: support footnoteDefinition

* test(cli): update snapshots

* refactor: extract SINGLE_LINE_NODE_TYPES

* refactor: printChildren

* fix: correct newlines

* test: add trailing newline

* fix: blockquote formatting

* fix: node types

* fix: break line correctly

* fix: remove unnecessary properties to make AST_COMPARE happy

* fix: escape `|` in tableCell content

* fix: unexpected line break

* fix: ast difference from loose list

* fix: html break lines

* refactor: fix linting

* fix: normalize ast

* fix: escape specific chars

* test: add more tests

* fix: build markdown parser

* chore: remove unnecessary *.log

* fix: escape html entity

* feat: support prettier-ignore

* fix: line break for non-loose listItem

* feat: support formatting `code` based on `lang`

* fix: add `jsx` and `tsx`

* fix: use multiparser

* refactor: fix linting

* test: update test case 😉

* feat: switch to `_` style emphasis

* fix: sequence list should use different prefix

* test: add tests

* fix: do not print additional new line after `prettier-ignore`

* fix(list): enforce `1.` to avoid unnecessary git diff

* feat: enable `commonmark` option

* feat: support `break`
* fix: escape backslash
* refactor: escape html entity using backslash

* fix: respect autolink-style link

* feat: support md`...` and markdown`...`

* docs: replace ands with commas

* fix: respect indented code block

* fix: respect html entity

* docs: add docs for modified MDAST

* fix: inlineCode is breakline-able

* feat: support backtick in inlineCode

* feat: support a-lot-of-backtick in fenced code block

* feat: use `~~~`-style code block in js template

* fix: respect escaped chars

* fix: use `*`-style emphasis for invalid `_`-style output

* test: add test cases

* fix: use `- - -`-style thematicBreak to avoid conflict with yaml

* fix: remain the same content for linkReference identifier

* fix: `inlineCode` gap can be a line break

* fix: `html` should not print trailing spaces if it's in root

* refactor: fix typo

* fix: wrap `definition`'s url if there's whitespace

* fix: remove unnecessary whitespace at the end of paragraph

* fix: fix: remove unnecessary whitespace at the start of paragraph

* fix: setence children length is possible 0

* fix: support continuous ordered list

* fix: do not print addtional hardline after loose list

* fix: use double-backtick style for single-backtick value in inlineCode

* fix: support nested emphasis

* fix: support space-url in link/image

* fix: escape `)` in link/image url

* fix: support single-quote in link/image/definition title

* fix: respect alt in image/imageReference

* fix: use `*`-style thematicBreak in list

* fix: loose/tight list linebreaks

* fix: print third linebreak before indented code block with a tight list in the previous

* test: move bug cases

* fix: remove unnecessary linebreaks

* refactor: fix typo
2017-10-12 09:46:44 +11:00