Commit Graph

18 Commits (952bc0cc039c034c5fe651864db528dcd9800e9e)

Author SHA1 Message Date
Ika 952bc0cc03
fix: get rid of CRLF (#5494) 2018-12-08 18:28:29 +08:00
Ika 514b6d3741 Bump Prettier dependency to 1.15.0 2018-11-07 09:12:25 +08:00
Ika 165742014a
fix(markdown): preserve leading/trailing newlines in fenced code block (#5038) 2018-09-01 13:35:29 +08:00
Ika 1790211f76
feat: support MDX (#4975)
* feat: support MDX

* refactor: flip condition
2018-08-13 22:23:09 +08:00
Ika 2271992446
feat(json): add jsonc to aliases and use it to find parser in markdown embed (#4734) 2018-07-07 20:46:34 +08:00
Ika 99c4e41fa1
feat: format yaml front matter (#4773)
* refactor: front-matter

* feat: format yaml front matter
2018-07-03 09:54:40 +08:00
Alexander Kachkaev a05fd118be Do not require space after markdown block language name (#4783)
https://github.com/prettier/prettier/pull/4153 made it possible to detect fenced code block language when it is followed by arguments (e.g. ` ```js {something=something} `). This PR makes it also possible to detect language in cases cases like ` ```js{something=something} ` (no space).

The reason for this change is that Atom highlights code blocks regardless of a space after the language name, which makes users wonder why the correctly detected code block is not being formatted:

<img width="324" alt="screen shot 2018-06-28 at 22 08 13" src="https://user-images.githubusercontent.com/608862/42060780-db11f5b6-7b1f-11e8-9f43-fe91843f7d89.png">

PR background: https://github.com/prettier/prettier/pull/4153#issuecomment-401174999
2018-07-02 08:22:56 +08:00
Lucas Azzola b0cb63a7bb
Use destructuring for imports (#4554)
* Use destructuring for imports

* Clean up integration tests

* Use moduleNameMapper for require_prettier
2018-05-27 21:36:12 +10:00
Lucas Duailibe 67f1c4877e
Refactoring: better boundaries for different parts of the project (#4364) 2018-04-25 13:29:35 -03:00
Ika 1f84880fb1
refactor: remove duplicate mapDoc (#4310) 2018-04-15 00:07:03 +08:00
Ika c814a9fa4d
fix(markdown): null check for code.lang (#4307) 2018-04-13 17:50:33 +08:00
Ika 0c09e150ba
feat(markdown): support fenced codeblock lang followed by attributes (#4153)
* test: add tests

* feat(markdown): support fenced codeblock lang followed by attributes
ref: https://shd101wyy.github.io/markdown-preview-enhanced/#/code-chunk

* refactor: set limit
2018-03-16 00:25:39 +08:00
Ika 2b283908cf fix(markdown): print literalline for newline instead of hardline (#4083)
* test: add tests

* fix(markdown): print literalline for newline instead of hardline

* test: add tests
2018-03-01 14:42:20 +02:00
Ika dc26445e51
refactor(options): use supportOptions to generate CLI options (#3622)
* refactor(cli-constant): use supportOptions

* refactor(options): use supportOptions

* refactor(cli-util): use supportOptions

* fix: do not infer parser in multiparser

* chore: remove unnecessary package

* chore: trigger another travis build

* test: add kebab-case test to ensure no regression

* test: update snapshots
2018-01-18 15:26:27 +08:00
Ika de6bc4448f
fix(multiparser): respect 0-indent markdown-in-js (#3676)
* fix(multiparser): respect 0-indent markdown-in-js

* fix: use literalline for 0-indent

* test: add unexpected case

* fix: 0-indent

* test: add failing test

* refactor: simplify

* fix(doc): literallines respect `ind.root`

* docs: update commands

* fix: what a magic...
2018-01-17 12:52:42 +08:00
Lucas Azzola e5d6a4704f
Automatically load plugins from package.json (#3624)
* Automatically load plugins from package.json

* Fix build by adding json extension

* Fixup misuse of options argument

* Rewire graceful-fs to fs

* Document graceful-fs issue

* Alias graceful-fs to fs in Rollup
2018-01-05 21:09:51 +11:00
Ika 6872ed8310 fix(markdown): replace newlines with hardlines in multiparser (#3611)
* test: add failing test

* fix(markdown): replace newlines with hardlines in multiparser
2017-12-30 10:33:58 -05:00
Lucas Azzola 4c9d4061da
Prettier Plugin API (#3536)
* Move files around in preparation for refactor

* Update paths in build script

* Extract generic printing logic from the JavaScript printer

* Conform printer API

* Fixup decorator handling

* Fix multiparser

* Create plugin entry for markdown

* Create plugin entry for javascript/typescript

* Create plugin entry for html

* Create plugin entry for graphql

* Create plugin entry for css/less/scss

* Move JSON to JS plugin entry

* Integrate plugins into getSupportInfo()

* Move astFormat to parser definition

* Move util to common

* Implement parser loading

* remark -> mdast

* Rename cli/cli -> cli/index

* Rename builder -> doc package, fix printer resolution

* Fix doc shape assumption in CSS-in-JS logic

* Fix third-party.js prod resolution

* Fixup build-docs script

* Distribute multiparser code

* Remove requirement to forward options

* Flatten closure

* Remove debug directory

* Expose doc

* Add external plugins

* Pass options to loadPlugins

* Export getParsers

* Pin resolve version

* Use getSupportInfo in Markdown embed

* Document plugin API

* Update build-docs

* Add CLI for plugins

* Lint docs

* Fixup build.js

* Add vue language

* Fixup multiparser for vue

* Upgrade rollup and rollup-plugin-commonjs

* Fixup third-party build

* Change AST format in docs
2017-12-26 12:23:50 +11:00