[css-text] Indent-preserving wrapping
Open
@frivoal is already working on this.
Since Sep 20, 2023.
Agenda+
css-text-4
- Dominant language
- Bikeshed
- Stars
- 4.9k
- Forks
- 816
- PR merge metrics
- PR metrics pending
Description
Taking some preformated content like:
<div>
<p>
This is a really long paragraph so you'd expect some form of wrapping
<span>
but there are lots of different ways of handling that.
</span>
</p>
</div>
Currently, white-space: pre-wrap lets you wrap it like this:
<div> |
<p> |
This is a really long paragraph so |
you'd expect some form of wrapping |
<span> |
but there are lots of different |
ways of handling that. |
</span> |
</p> |
</div> |
But, with code and markup, wrapping like this is much better:
<div> |
<p> |
This is a really long paragraph so |
you'd expect some form of wrapping |
<span> |
but there are lots of different |
ways of handling that. |
</span> |
</p> |
</div> |
…where the indenting of each line is preserved. Here's a demo of the behaviour.
This behaves as if each soft wrap repeats the whitespace from the start of the line (although this wouldn't appear in copied text).
It'd be nice if CSS could enable this.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.