So far, prettier formats our HTML and SCSS files. It doesn't change the Markdown files. The main benefit of auto-formatting Markdown files is the automatic wrapping of lines, making it easier to read.
I tried:
- prettier without additional plugins and
proseWrap: always ➡️ Breaks shortcodes
- prettier-plugin-hugo-post with
proseWrap: always ➡️ Works better, but breaks self-closing shortcodes and sometimes moves shortcode sections in one line.
Requirements:
We might need to write our own formatter to achieve the goals.
So far, prettier formats our HTML and SCSS files. It doesn't change the Markdown files. The main benefit of auto-formatting Markdown files is the automatic wrapping of lines, making it easier to read.
I tried:
proseWrap: always➡️ Breaks shortcodesproseWrap: always➡️ Works better, but breaks self-closing shortcodes and sometimes moves shortcode sections in one line.Requirements:
Auto-wrap lines after 80 characters (to be able to view the content on smaller displays)
Place each shortcode opening or closing tag in a new line:
{{% highlight important %}} Example {{% /highlight %}}instead of
{{% highlight important %}} Example {{% /highlight %}}We might need to write our own formatter to achieve the goals.