* Add support for [[wiki-style]] links in markdown
1. Support for [[wiki-style]] links ensures that they do not get broken
by the prettier formatting by being wrapped over multiple lines.
2. The contents of the link (between the `[[]]` brackets) are treated
as raw text. This is because the various tools that rely on the
`[[]]` syntax do not agree on what is allowable between them.
* Add a changelog document
* Update pr-9275.md
* Add additional tests as requested
* Add a fix for AST tests
* Fix issues with prose-wrap: "preserve"
* Lint
* Add a clean action for wikiLinks
Co-authored-by: fisker Cheung <lionkay@gmail.com>
* Update `remark-parse` to v7
* fix `link` title and `inlineCode`
* fix `code` meta
* fix code meta
* fix ListItem print
* fix heading print result
* remove blank line before childList
* trim `inlineCode` ast
* use List.spread
* use ListItem.spread
* fix `example-550.md` snap
* update `example-522.md` snap
* update `example-508.md` snap
* update `example-509.md` snap
* update `example-222.md` snap
* Update listitem print
* lower case definition.label to match ast
* trim definition.label to match ast
* trim definition.label to match ast
* unescape Link.title
* filter link with no title
* fix link title
* fix link title
* restore preprocess
* fix ast massage
* Restore list
* Update to remark-parse 8.0.2
* Update snapshot tests after rebase
* Create legacy `loose` attribute from `spread`
Uses @duailibe's suggestion from here:
https://github.com/prettier/prettier/issues/6180#issuecomment-499498432
Also backtracks some other unnecessary changes.
* Update test case for shortcut reference-style links
The commonmark spec does not allow for whitespace between the left and right
parts of a full reference-style link.
https://spec.commonmark.org/dingus/?text=%5Bfoo%5D%20%5Bbar%5D%0A%0A%5Bbar%5D%3A%20%2Furl%20%22title%22%0A
Notice that the `[foo]` is parsed as plain text, while the `[bar]` is parsed
as a shortcut reference link.
When there is a space between the two, each part is parsed as a separate
shortcut style reference link node:
https://astexplorer.net/#/gist/d69f5a227e2cbde3f43f0a639bee165c/822b531c252c162faba78e38607db73ef72886d5
Previously they would have been parsed as a single full reference link.
Here I update the test-case to account for the shortcut style links.
* Add remark-footnotes plugin to replace legacy footnotes option
Remark removed the footnotes option in favor of a new remark-footnotes
plugin in https://github.com/remarkjs/remark/pull/483
Here I've simply switched to use the plugin instead of the removed
option and updated the snapshot tests.
* Add test case for #4369
* Do not add gap if has leading space
* Restore `inlineCode` ast compare
* Restore `isPrevNodeLooseListItem`
* Ignore some ast property
* Restore blank line, Fix `isPrevNodeLooseListItem` check
* Title compare
* Ignore `loose`
* Fix footnoteDefinition
* Fix tabWidth
* Style
* `footnoteDefinition` is stable now
* Fix `_` after link
* Revert workaround, url tests
* Fix idempotence issue with underscores and autolinks
* Fix idempotence issue with underscores and autolinks - attempt # 2
* Fix idempotence issue with underscores and autolinks - attempt # 3
* Fix idempotence issue with underscores and autolinks - part # 4
* More tests
* Code style
* Only test master passed tests
* Update list
* Update list
* Use code as test name
* Fix idempotence issue with underscores and autolinks - part # 5
* Fix idempotence issue with underscores and autolinks - part # 6
* Linting fix
* More autolink tests
* Fix tests
* Rename to `auto-link`
* More tests
* Disable new cases
* tests for issue 4122
* add changelog
Co-authored-by: fisker <lionkay@gmail.com>
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
* Run `format()` in test function
* Wrap `test`s in `describe`
* Update tests_config/run_spec.js
Co-Authored-By: Georgii Dolzhykov <thorn.mailbox@gmail.com>
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
* 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
* 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
* 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
* 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
* 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