You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apply word_wrap to a block of text that contains some indented lines:
This is a paragraph with an initial indent,
followed by additional lines that are not indented,
and finally terminated with a blockquote:
"A pithy saying by a wise person"
Expected behavior
A line break should be inserted at the appropriate character limit, but the leading spaces should not be removed. For example, if str contains the example above, word_wrap(str, line_width: 25) should produce:
This is a paragraph
with an initial indent,
followed by additional
lines that are not
indented,
and finally terminated
with a blockquote:
"A pithy saying by a
wise person"
Actual behavior
For any line that exceeds the configured length, white space is stripped from the beginning as well as the end of the line, even though that leading white space was included in the character count that determined how long the line was:
This is a paragraph
with an initial indent,
followed by additional
lines that are not
indented,
and finally terminated
with a blockquote:
"A pithy saying by a
wise person"
System configuration
Rails version: All Ruby version: All
The text was updated successfully, but these errors were encountered:
mullican
changed the title
TextHelper#word_wrap should not strip spaces from the left side of the wrapped string
TextHelper#word_wrap should not strip spaces from the left side of the wrapped string
Nov 19, 2018
mullican
added a commit
to mullican/rails
that referenced
this issue
Nov 19, 2018
Steps to reproduce
Apply
word_wrap
to a block of text that contains some indented lines:Expected behavior
A line break should be inserted at the appropriate character limit, but the leading spaces should not be removed. For example, if
str
contains the example above,word_wrap(str, line_width: 25)
should produce:Actual behavior
For any line that exceeds the configured length, white space is stripped from the beginning as well as the end of the line, even though that leading white space was included in the character count that determined how long the line was:
System configuration
Rails version: All
Ruby version: All
The text was updated successfully, but these errors were encountered: