Commit Graph

14 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
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 6447d30b0b
feat(markdown): change unordered list symbol to hyphen (#4440) 2018-05-10 14:32:52 +08:00
Ika b6c27893cc
fix(markdown): list prefix alignment: count spaces from correct place (#4041)
* test: add tests

* fix(markdown): list prefix alignment: count spaces from correct place

* docs: codeblock -> code block
2018-02-26 08:53:09 +08: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
Ika 08b9e07207
fix(markdown): update remark-parse to v5.0.0 (#3780)
* fix(markdown): update remark-parse to v5.0.0

* test(markdown): ensure links with entities printed correctly

* test(markdown): ensure lists  interrupted by headings
2018-01-21 12:31:30 +08:00
Ika 3df7d60a7f feat(markdown): respect `tabWidth` for list indentation (#3694)
* test: add test case

* feat(markdown): respect `tabWidth` for list indentation

* test: add extreme `tabWidth` test case
2018-01-10 18:45:22 +11: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 d5a3abd7a6
fix(markdown): only indent the first non-list node in checkbox list item (#3297)
* fix(markdown): do not indent checkbox

* fix: keep alignment for first non-list node

* fix: force whitespaces
2017-11-22 00:01:59 +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 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