-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
HTML Writer: LineBlock should use <br>, not <div> with CSS white-space property #4162
Comments
It seems we have being going back and forth on this one a couple of times (e.g. here)... but in principle, I agree, we could just emit Then again, I don't really see much of an advantage for the change either. The two reasons mentioned above seem fairly theoretical. But yes, we could get rid of a few lines of CSS in the templates. What does @tarleb think, who introduced the LineBlock element? |
If I understand this correctly, the question is whether to use inline css styling " Since there is no "line block" element in html, I think it makes sense to produce them with |
Cutting out any semantical correctnes arguments in this case, I agree that |
Almost. It's about whether to use |
Thanks for the clarification, @mb21 ! |
Thanks, John. |
+++ hftf [Dec 26 17 17:00 ]:
Thanks, John.
Fwiw, I also suggested that the HTML Reader recognize <div
class="line-block"> as LineBlock.
Done.
|
Related:
HTML Writer converts LineBreak to
<div>
with style attributeHTML Writer converts LineBreak to
<div>
with class instead of style attributeThere are problems with using a div with style to indicate a line block. First, it is presentational, not semantic: HTML's
<div>
does not have the meaning of preserving line breaks, but HTML already does have a semantic element to indicate line breaks:<br>
. When CSS is disabled or broken, the block is rendered incorrectly without any line breaks. It also cannot be round-trip converted back intoLineBlock
:I would like to propose that the HTML Writer be modified like so:
and that the HTML Reader also be modified to recognize such markup as
LineBlock
.I could also not find any HTML tests for LineBlock (but there are a few in the unmerged PR #1545).
The text was updated successfully, but these errors were encountered: