dindent icon indicating copy to clipboard operation
dindent copied to clipboard

text within <textarea>...</textarea> should preserve line breaks

Open nbogol opened this issue 10 years ago • 5 comments

nbogol avatar Feb 02 '15 23:02 nbogol

also, preformatted text (< pre >)

tccki avatar Apr 08 '15 23:04 tccki

Same Issue here...

horstoeko avatar Dec 26 '15 10:12 horstoeko

Can be easily done by identifying the <pre> and <textarea> tags and not indenting their contents.

The problem is that the text flow behaviour depends on the CSS property line-break. This fix will address <textarea> input value problem, but will not do anything about other elements that have line-break: pre set.

gajus avatar Dec 28 '15 13:12 gajus

Yes, the CSS property line-break makes the problem practically undecidable.

As a workaround, we could use a configuration option to set the tag names that must be preserved, with a default of ['script', 'textarea', 'pre']

tobia avatar Jun 06 '16 10:06 tobia

+1 to a configuration option for skipping specific tags. I ran into this problem with <pre> tags today.

aaronpk avatar Feb 03 '17 22:02 aaronpk