Skip to content
This repository has been archived by the owner on Mar 26, 2021. It is now read-only.

Stripping whitespace should not be default #21

Open
H0L0GH05t opened this issue Apr 30, 2015 · 0 comments
Open

Stripping whitespace should not be default #21

H0L0GH05t opened this issue Apr 30, 2015 · 0 comments

Comments

@H0L0GH05t
Copy link

Why does django softhyphen strip whitespace indefinitely? I have a case where the paragraph I'm hyphenating has a style tag <em> around the first word of the paragraph, and that text has a space at the end of the text in the <em> tag, or after the </em> tag which is getting stripped out.

This is an example of what the text looks like with the space inside the <em> tag:

<p><em>Test. </em>This is a test paragraph.</p>

This is an example of what the text looks like with the space after the <em> tag:

<p><em>Test.</em> This is a test paragraph.</p>

The result after hyphenation in either case is:

<p><em>Test.</em>This is a test paragraph.</p>

I can fix this locally by changing STRIP_WHITESPACE.sub(...) to re.sub(...) but it would be nice to be able to choose if I want to strip whitespace or not. Is there a reason the whitespace is always stripped? Can this be default to strip, but I can override it?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant