diff --git a/CHANGELOG.md b/CHANGELOG.md index e53f6da..62fe573 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,11 @@ # Next +- Switch to Remark as a default markdown beautifier due to a more active state of its community compared to Tidy Markdown ([#2004](https://github.com/Glavin001/atom-beautify/pull/2004)). + This is a __breaking change__ for Tidy Markdown users: + - list indentation is now four characters per level (three spaces after `-` for unordered lists and two spaces after `N.` in ordered lists) + - the contents of frontmatter are no longer formatted + + You can easily switch back to the old behaviour by choosing _Tidy Markdown_ in package preferences. + Alternatively, you can customise Remark beautifier with `.jsbeautifyrc` (see [available options](https://github.com/remarkjs/remark/tree/master/packages/remark-stringify#options)). - Add GN language and beautifier - Add the option to indent Bash with tabs [#1951](https://github.com/Glavin001/atom-beautify/issues/1951) - See [#1980](https://github.com/Glavin001/atom-beautify/pull/1980). Add VHDL beautifier and language support. diff --git a/README.md b/README.md index a5e93ae..d86cf89 100644 --- a/README.md +++ b/README.md @@ -182,7 +182,7 @@ See [all supported options in the documentation at `docs/options.md`](docs/opti | LaTeX | `BibTeX`, `LaTeX`, `TeX` |`.bib`, `.tex`, `.sty`, `.cls`, `.dtx`, `.ins`, `.bbx`, `.cbx` | **[`Latex Beautify`](https://github.com/cmhughes/latexindent.pl)** | | LESS | `LESS` |`.less` | **[`Pretty Diff`](https://github.com/prettydiff/prettydiff)**, [`CSScomb`](https://github.com/csscomb/csscomb.js), [`Prettier`](https://github.com/prettier/prettier) | | Lua | `Lua` |`.lua`, `.ttslua` | **[`Lua beautifier`](https://github.com/Glavin001/atom-beautify/blob/master/src/beautifiers/lua-beautifier/beautifier.coffee)** | -| Markdown | `GitHub Markdown` |`.markdown`, `.md` | **[`Tidy Markdown`](https://github.com/slang800/tidy-markdown)**, [`Prettier`](https://github.com/prettier/prettier), [`Remark`](https://github.com/wooorm/remark) | +| Markdown | `GitHub Markdown` |`.markdown`, `.md` | **[`Remark`](https://github.com/remarkjs/remark)**, [`Prettier`](https://github.com/prettier/prettier), [`Tidy Markdown`](https://github.com/slang800/tidy-markdown) | | Marko | `Marko` |`.marko` | **[`Marko Beautifier`](https://github.com/marko-js/marko-prettyprint)** | | Mustache | `HTML (Mustache)` |`.mustache` | **[`JS Beautify`](https://github.com/beautify-web/js-beautify)**, [`Pretty Diff`](https://github.com/prettydiff/prettydiff) | | Nginx | `nginx` |`.conf` | **[`Nginx Beautify`](https://github.com/denysvitali/nginxbeautify)** | diff --git a/docs/options.md b/docs/options.md index 9605536..706b1ab 100644 --- a/docs/options.md +++ b/docs/options.md @@ -7844,7 +7844,7 @@ Disable Markdown Beautification **Important**: This option is only configurable from within Atom Beautify's setting panel. -**Default**: `Tidy Markdown` +**Default**: `Remark` **Type**: `string` diff --git a/examples/nested-jsbeautifyrc/.jsbeautifyrc b/examples/nested-jsbeautifyrc/.jsbeautifyrc index 693c649..e911504 100644 --- a/examples/nested-jsbeautifyrc/.jsbeautifyrc +++ b/examples/nested-jsbeautifyrc/.jsbeautifyrc @@ -56,6 +56,11 @@ indent_size: 4 markdown: listItemIndent: 1 + strong: '_' + emphasis: '_' + fences: true + fence: '`' + setext: true jade: indent_size: 4 indent_char: " " diff --git a/examples/nested-jsbeautifyrc/markdown/expected/code-blocks.md b/examples/nested-jsbeautifyrc/markdown/expected/code-blocks.md new file mode 100644 index 0000000..012f43e --- /dev/null +++ b/examples/nested-jsbeautifyrc/markdown/expected/code-blocks.md @@ -0,0 +1,17 @@ +A code block with correct fences: + +```js +console.log('hello world!') +``` + +A code block with mistyped fences: + +```js +console.log('hello world!') +``` + +Code block with forgotten fences: + +``` +console.log('hello world!') +``` diff --git a/examples/nested-jsbeautifyrc/markdown/expected/headers.md b/examples/nested-jsbeautifyrc/markdown/expected/headers.md new file mode 100644 index 0000000..a8e695a --- /dev/null +++ b/examples/nested-jsbeautifyrc/markdown/expected/headers.md @@ -0,0 +1,9 @@ +Header 1 +======== + +Header 2 +-------- + +### Header 3 + +Hello! diff --git a/examples/nested-jsbeautifyrc/markdown/expected/inline-markers.md b/examples/nested-jsbeautifyrc/markdown/expected/inline-markers.md new file mode 100644 index 0000000..f56d701 --- /dev/null +++ b/examples/nested-jsbeautifyrc/markdown/expected/inline-markers.md @@ -0,0 +1,3 @@ +An example of __bold__ and _italics_. + +Another example of __bold__ and _italics_. diff --git a/examples/nested-jsbeautifyrc/markdown/expected/test.md b/examples/nested-jsbeautifyrc/markdown/expected/lists.md similarity index 97% rename from examples/nested-jsbeautifyrc/markdown/expected/test.md rename to examples/nested-jsbeautifyrc/markdown/expected/lists.md index 260f04f..6cda824 100644 --- a/examples/nested-jsbeautifyrc/markdown/expected/test.md +++ b/examples/nested-jsbeautifyrc/markdown/expected/lists.md @@ -1,5 +1,4 @@ - item - 1. one 2. two 3. three diff --git a/examples/nested-jsbeautifyrc/markdown/original/code-blocks.md b/examples/nested-jsbeautifyrc/markdown/original/code-blocks.md new file mode 100644 index 0000000..686caf5 --- /dev/null +++ b/examples/nested-jsbeautifyrc/markdown/original/code-blocks.md @@ -0,0 +1,15 @@ +A code block with correct fences: + +```js +console.log('hello world!') +``` + +A code block with mistyped fences: + +~~~js +console.log('hello world!') +~~~ + +Code block with forgotten fences: + + console.log('hello world!') diff --git a/examples/nested-jsbeautifyrc/markdown/original/headers.md b/examples/nested-jsbeautifyrc/markdown/original/headers.md new file mode 100644 index 0000000..cf264a3 --- /dev/null +++ b/examples/nested-jsbeautifyrc/markdown/original/headers.md @@ -0,0 +1,7 @@ +# Header 1 + +## Header 2 + +### Header 3 + +Hello! diff --git a/examples/nested-jsbeautifyrc/markdown/original/inline-markers.md b/examples/nested-jsbeautifyrc/markdown/original/inline-markers.md new file mode 100644 index 0000000..c3d1a8b --- /dev/null +++ b/examples/nested-jsbeautifyrc/markdown/original/inline-markers.md @@ -0,0 +1,3 @@ +An example of **bold** and *italics*. + +Another example of __bold__ and _italics_. diff --git a/examples/nested-jsbeautifyrc/markdown/original/test.md b/examples/nested-jsbeautifyrc/markdown/original/lists.md similarity index 100% rename from examples/nested-jsbeautifyrc/markdown/original/test.md rename to examples/nested-jsbeautifyrc/markdown/original/lists.md diff --git a/examples/simple-jsbeautifyrc/markdown/expected/test.md b/examples/simple-jsbeautifyrc/markdown/expected/test.md index 9bef71c..1c3eeda 100644 --- a/examples/simple-jsbeautifyrc/markdown/expected/test.md +++ b/examples/simple-jsbeautifyrc/markdown/expected/test.md @@ -1,11 +1,11 @@ # heading 1 -- item -- item -- item +- item +- item +- item ## heading 2 -1. one -2. two -3. three +1. one +2. two +3. three diff --git a/examples/simple-jsbeautifyrc/markdown/expected/yaml-front-matter-3.md b/examples/simple-jsbeautifyrc/markdown/expected/yaml-front-matter-3.md index 5f92234..1ec8989 100644 --- a/examples/simple-jsbeautifyrc/markdown/expected/yaml-front-matter-3.md +++ b/examples/simple-jsbeautifyrc/markdown/expected/yaml-front-matter-3.md @@ -13,15 +13,12 @@ pets: - bat match: !!js/regexp /pattern/gim run: !!js/function function() { } - - - --- -- item -- item +- item +- item - item -1. one +1. one 2. two -2. three +3. three diff --git a/examples/simple-jsbeautifyrc/markdown/expected/yaml-front-matter.md b/examples/simple-jsbeautifyrc/markdown/expected/yaml-front-matter.md index efd85dc..fe81501 100644 --- a/examples/simple-jsbeautifyrc/markdown/expected/yaml-front-matter.md +++ b/examples/simple-jsbeautifyrc/markdown/expected/yaml-front-matter.md @@ -1,7 +1,8 @@ --- -layout: default -title: this is my title -description: this is my description +layout: default +title: this is my title +description: this is my description --- -test ing + test + ing diff --git a/src/beautifiers/remark.coffee b/src/beautifiers/remark.coffee index 2f34ca9..4885919 100644 --- a/src/beautifiers/remark.coffee +++ b/src/beautifiers/remark.coffee @@ -3,7 +3,7 @@ Beautifier = require('./beautifier') module.exports = class Remark extends Beautifier name: "Remark" - link: "https://github.com/wooorm/remark" + link: "https://github.com/remarkjs/remark" options: { _: { gfm: true diff --git a/src/languages/markdown.coffee b/src/languages/markdown.coffee index 2f6aaea..a6a3ad1 100644 --- a/src/languages/markdown.coffee +++ b/src/languages/markdown.coffee @@ -18,7 +18,7 @@ module.exports = { "md" ] - defaultBeautifier: "Tidy Markdown" + defaultBeautifier: "Remark" options: gfm: diff --git a/src/options.json b/src/options.json index c5c8092..b339a2d 100644 --- a/src/options.json +++ b/src/options.json @@ -4573,7 +4573,7 @@ "title": "Default Beautifier", "order": -2, "type": "string", - "default": "Tidy Markdown", + "default": "Remark", "description": "Default Beautifier to be used for Markdown", "enum": [ "Prettier",