denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
93.96k stars 5.23k forks source link

Set prose-wrap to `preserve` by default #25137

Open ryuapp opened 3 weeks ago

ryuapp commented 3 weeks ago

This cons may not exist in anglosphere, but a popular Japanese technology blog site (Zenn) recognizes new lines in markdown as new lines, so when markdown is formatted using deno fmt, it will break. Also, the commonly used Prettier's defaults to prose-wrap: preserve. Therefore, it is better to set prose-wrap to preserve by default.

I understand that it can be changed in the options, but I don't know the pros of setting it to always by default.

Related: https://github.com/denoland/deno/issues/9191 https://github.com/prettier/prettier/issues/6516

dsherret commented 3 weeks ago

I personally prefer preserve (it's the default in dprint-plugin-markdown)

lucacasonato commented 3 weeks ago

I don't have very strong opinions, but the pro of setting it to always is that you always linebreak at 80 columns - you don't get very long lines.

ryuapp commented 3 weeks ago

I don't have very strong opinions, but the pro of setting it to always is that you always linebreak at 80 columns - you don't get very long lines.

After seeing this, I realized that the problem is that deno fmt does not support natural language formats such as Japanese and Chinese in the first place. I stated the problem there(https://github.com/dprint/dprint-plugin-markdown/issues/120).

Natural languages ​​like Japanese and Chinese do not use spaces to separate text. However, English words often appear in sentences, so they are separated unnaturally. Ref: https://en.wikipedia.org/wiki/Word_divider#Types

I don't know if deno fmt will support them in the future, but basically it is difficult to properly separate those languages text. That's why I think preserve being the default is very valuable.