* Remove artifacts from repo
* Remove docs stuff from build script
* Add new docs build script
* Add 'third-party' shim in playground worker
* Build from src if it's a PR
* Add command to package.json and remove old stuff from travis
* Implement getSupportInfo() and use it for inference
* Add comment with source of languages.yml
* Fix build, pin semver
* Simplify test snapshots
* Remove stray 'type' property
* Fix parser being overwritten
* Don't infer unreleased parser from extension
* Add CLI and docs for support info
* refactor: extract `splitText`
* fix: respcet CJK width in table
* test: add failing test
* fix: support emoji
* test: add failing test
* feat: support CJK character
* feat: enable adding whitespace between non-CJK/CJK-character by default
* fix: do not print softline at node that is sensitive to its identifier
* fix: treat full-width whitespace as CJK punctuation
* disallow leading/trailing full-width whitespace
* feat: remove `--split-cjk-text` option and enable it by default
* refactor: simplify regex and remove unnecessary `g` flag
* 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
* Add option to insert @format pragma if absent
prependPragma --> insertPragma
add tst dir, move stripBom, add to README, update snapshots
remove noise from test + update snapshots
use jest@test new functions, update docs, rerun snapshots
fix accidental upgrade to jest@test
update jest-docblock again to latest with strip()
updated snapshot
* updated snapshots
* revert jest dep change
* apply a trim to parsed comments
* remove empty object
* Revert "apply a trim to parsed comments"
This reverts commit 467f71ce5f4b4f8a1b5c4474ee0484bc96c92141.
* rerun snapshots with proper jest version
* pin jest-docblock to latest @test release
* comment out docs for new feature from readme
* remove leading newlines
* ensure blank line between docblock and rest of file
* remove backtick string
* Split Less and SCSS parsing into different parsers
Now, .less files are always parsed with postcss-less, and .scss files
areare always parsed with postcss-scss. This:
- Is less hacky.
- Is meant to avoid issues like #2829.
- Is probably more performant.
`parser: "postcss"` and `--parser postcss` continue to work like before:
First trying postcss-less, and if that fails, postcss-scss, unless a
regex says that we should try in the opposite order. The new values for
the parser option are "postcss-less" and "postcss-scss".
* Remove postcss from package.json since it is not used
* Rename parser-less to less and parser-scss to scss
* Deprecate parser:postcss in favor of parser:css
* Fix CSS tests
* Upgrade cosmiconfig to v3, remove hardcoded combinatoric problem
* Fix indendation change from 1.7
* Ensure default value for useCache is true
* Pin mem version
* Add option to require @prettier or @format pragma
Fixes#2397.
Inspired by `eslint-plugin-prettier` and the discussion in #2397, this
implements requiring a special comment pragma to be present in a file's
first comment in order to be formatted.
This will help large codebases gradually transition to prettier over
time without tons of churn or large code reviews.
I implemented this as a standard prettier "option", not just a typical
`argv` flag, as it is relevant in both the cli and the api. This way it
can be provided programmatically, on the command line, or standardized
in a prettierrc file so like the style options, every user can use this
setting consistently and only apply prettier to relevant files, no
mattier their editor integration.
This requires the pragma begin with `@` (in fact it's inserted if the
user doesn't provide it). Currently the usage implies it must be
"prettier" or "format", but it can technically be any value other than
"none", which is similar to the `trailingCommas` option.
cc @vjeux
* Don't quote anything in runPrettier; this is usually handled by a shell
* Make --require-pragma a boolean option
* Use jest-docblock to find pragmas without parsing the ast
* Clarify docs
* includes -> indexOf
* Move test out of integration