Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for HTML wrap_line_length #423

Closed
wants to merge 2 commits into from

Conversation

nponiros
Copy link

When given a wrap_line_length of 0 without specifying a max_char
then the given wrap_line_length would be overwritten by an
undefined value for max_char.
This results in the html beautifier ignoring the wrap_line_length
of 0 given by the user and setting a default wrap_line_length of
250.

Fix this by removing the check for wrap_line_length === 0 in
the max_char compatibility if condition.

A test is included to set the wrap_line_length to 0 and call
the beautifier with a p tag containing a string which is longer
than 250 characters and expecting no changes in the string.

This pull request is related to issue #342

When given a wrap_line_length of 0 without specifying a max_char
then the given wrap_line_length would be overwritten by an
undefined value for max_char.
This results in the html beautifier ignoring the wrap_line_length
of 0 given by the user and setting a default wrap_line_length of
250.

Fix this by removing the check for wrap_line_length === 0 in
the max_char compatibility if condition.

A test is included to set the wrap_line_length to 0 and call
the beautifier with a p tag containing a string which is longer
than 250 characters and expecting no changes in the string.
@bitwiseman bitwiseman added this to the v1.5.0 milestone Mar 17, 2014
@bitwiseman bitwiseman added the bug label Mar 17, 2014
@bitwiseman
Copy link
Member

Thanks!
I cannot repro the error on website when using the <span>, but I can repro with <p>.
Could you also add a test with the <p> tag and then I'll merge.

@bitwiseman bitwiseman added declined and removed bug labels Mar 20, 2014
@bitwiseman bitwiseman removed this from the v1.5.0 milestone Mar 20, 2014
@bitwiseman
Copy link
Member

Another pull request came in that looked cleaner, took that. Thanks anyway!

@bitwiseman bitwiseman closed this Mar 20, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants