3

I have a long text in p tag and Prettier splits the text in this tag to multiple lines. I have 'word wrap' enabled.

How can I stop this from happening?

Before Save: long text enclosed in p tag before save

After Save: long text split into multiple lines after save

rioV8
  • 24,506
  • 3
  • 32
  • 49

2 Answers2

1

Prettier is opinionated, it has only limited number of options. If you couldn’t find what you want in https://prettier.io/docs/en/options.html, so it’s not supported.

In general, better to accept Prettier behavior instead of fight against it. The reformatting, that prettier does, doesn’t harm.

You can try to increase width.

Michael Freidgeim
  • 26,542
  • 16
  • 152
  • 170
0

1. Strech VS Code Window
Simply stretch/widen your VS code window and it'll get "fixed":

Strech/widen your VS Code Window

2. Change Print Width
As you can see from 1, it's not a real problem.
You can however also experiment with adjusting Prettier Print Width.

  1. Open VS code
  2. Click Manage > Settings
  3. Type in "Prettier" and scroll down to Prettier: Print Width to change it.

How to change Prettier Print Width

Laz
  • 83
  • 1
  • 5