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

Support for inline pre elements #16

Open
martincizek opened this issue Mar 24, 2020 · 0 comments
Open

Support for inline pre elements #16

martincizek opened this issue Mar 24, 2020 · 0 comments

Comments

@martincizek
Copy link

collapse-whitespace behaves perfectly for block PRE elements, such as the default <PRE> tag.

But there are use cases where users need preformatted behavior on inline elements. For example, GitLab's CSS for the <code> tag is set as white-space: pre-wrap;. The browser behavior is then as follows, but collapse-whitespace is not consistent with that.

<div class="test"><code>four    spaces</code></div>
<div class="result"><code>four    spaces</code></div>
<div class="test">Space <code>no space</code> more space</div>
<div class="result">Space <code>no space</code> more space</div>
<div class="test">Space <code> leading code space</code> more space</div>
<div class="result">Space <code> leading code space</code> more space</div>
<div class="test">Space <code>trailing code space </code> more space</div>
<div class="result">Space <code>trailing code space </code> more space</div>
<div class="test">Space <code>trailing code space </code><b> more space in tag</b></div>
<div class="result">Space <code>trailing code space </code><b> more space in tag</b></div>
<div class="test">Space <code>trailing code space </code> <b> more space after code and tag</b></div>
<div class="result">Space <code>trailing code space </code> <b>more space after code and tag</b></div>
<div class="test"><b>Space before tag </b><code>my code</code></div>
<div class="result"><b>Space before tag </b><code>my code</code></div>
<div class="test"><b>Space before tag and code </b> <code>my code</code></div>
<div class="result"><b>Space before tag and code </b><code>my code</code></div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant