CSS: increase spacing before and after <blockquote> #5409

Closed
opened 2025-10-17 15:16:52 +00:00 by hl · 7 comments
Contributor

example: https://fsfe.org/news/2025/news-20251015-01.en.html

looks like this:

<p></p>

<blockquote>
  “quote”
</blockquote>

<p></p>

https://git.fsfe.org/FSFE/fsfe-website/src/branch/master/fsfe.org/news/2025/news-20251015-01.en.xhtml

@dario

instead, the CSS for the blockquote should be changed, but then all these occurrences need to be changed too

example: https://fsfe.org/news/2025/news-20251015-01.en.html looks like this: ``` <p></p> <blockquote> “quote” </blockquote> <p></p> ``` https://git.fsfe.org/FSFE/fsfe-website/src/branch/master/fsfe.org/news/2025/news-20251015-01.en.xhtml @dario instead, the CSS for the blockquote should be changed, but then all these occurrences need to be changed too
Member

Yes, this seems like a problem to be solved in CSS. We have a bad habit of (ab) using HTML features like this, or of using inline CSS for this kind of issue, see #2736.

But this should be solved in the look/ less files.

Yes, this seems like a problem to be solved in CSS. We have a bad habit of (ab) using HTML features like this, or of using inline CSS for this kind of issue, see https://git.fsfe.org/FSFE/fsfe-website/issues/2736. But this should be solved in the look/ less files.
Author
Contributor

ok this is not needed, block quotes have good distancing.

likely some conversion tool produced weird results?

ok this is not needed, block quotes have good distancing. likely some conversion tool produced weird results?
Member

Are the files in question generated using first a libre office doc (.odt), and then converted to HTML?

I wonder if it inserts a <p> for every newline in the source doc or something.

Or this may just be a case of someone doing it once, and it being copied to every new file. There are many such cases with CSS attributes and similar across the website, especially in the news section.

Are the files in question generated using first a libre office doc (.odt), and then converted to HTML? I wonder if it inserts a `<p>` for every newline in the source doc or something. Or this may just be a case of someone doing it once, and it being copied to every new file. There are many such cases with CSS attributes and similar across the website, especially in the news section.
Owner

At least in Firefox the empty <p></p> seems to be removed/collapsed while rendering. When I remove the two empty paragraphs from the HTML code, the displayed page did not change at all.

At least in Firefox the empty `<p></p>` seems to be *removed*/collapsed while rendering. When I remove the two empty paragraphs from the HTML code, the displayed page did not change at all.
Member

FIrstly, some more info on empty paragraps in html:

TLDR: empty paragraphs are valid html, but should not be displayed by browsers, and are bad for accessibility.

We could

  • Do nothing. The weird paragraphs seem to have no visual effect, and so are just weird source code. This is fine, but not ideal.
  • Add something to the python code to remove empty paragraphs as part of the transformation. This works, but I would consider that it violates the principle of least surprise pretty badly, and will incur a performance cost every build, forever. Not ideal.
  • Add something to the pre commit checker that fails if they are present, and we must manually remove them. Seems okay to me.
  • Add a pre commit hook that runs an xsl stylesheet that just removes the empty paragraphs from a file. Could also have a pre commit hook that checks they are no longer present. This would also involve formatting all xhtml files probably. I had avoided this, soas to ensure that it was easy for peole to contribute xhtml files from the webinterface without setting up a local devenv, as we often see.
FIrstly, some more info on empty paragraps in html: - https://stackoverflow.com/questions/14848326/empty-paragraph-tags-should-i-allow-in-html-editor-or-not - https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/p#accessibility TLDR: empty paragraphs are valid html, but should not be displayed by browsers, and are bad for accessibility. We could - Do nothing. The weird paragraphs seem to have no visual effect, and so are just weird source code. This is fine, but not ideal. - Add something to the python code to remove empty paragraphs as part of the transformation. This works, but I would consider that it violates the principle of least surprise pretty badly, and will incur a performance cost every build, forever. Not ideal. - Add something to the pre commit checker that fails if they are present, and we must manually remove them. Seems okay to me. - Add a pre commit hook that runs an xsl stylesheet that just removes the empty paragraphs from a file. Could also have a pre commit hook that checks they are no longer present. This would also involve formatting all xhtml files probably. I had avoided this, soas to ensure that it was easy for peole to contribute xhtml files from the webinterface without setting up a local devenv, as we often see.
Member

So, I have both check and format pre-commit hooks implemented in #5431 , I like the format hook except xsltproc makes a few changes, seemingly unavoidably, that result in a diff of +79124 -126340

So, I have both check and format pre-commit hooks implemented in https://git.fsfe.org/FSFE/fsfe-website/pulls/5431 , I like the format hook except `xsltproc` makes a few changes, seemingly unavoidably, that result in a diff of `+79124 -126340`
tobiasd referenced this issue from a commit 2025-10-30 12:35:01 +00:00
Member

Should this be closed, as we have merged #5431?

Should this be closed, as we have merged https://git.fsfe.org/FSFE/fsfe-website/pulls/5431?
Sign in to join this conversation.
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: FSFE/fsfe-website#5409