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

Empty paragraphs <p> not being displayed #24

Open
mjefim opened this issue Oct 10, 2024 · 4 comments
Open

Empty paragraphs <p> not being displayed #24

mjefim opened this issue Oct 10, 2024 · 4 comments

Comments

@mjefim
Copy link

mjefim commented Oct 10, 2024

Hi, I am trying to render html that contains empty paragraphs to provide some spacing in the text. The issue is that if the paragraphs are empty the output does not seem to contain them. I am attaching the test html and a screenshot of the output (please ignore the yellow masking, it just hides other information).

Image of the output:
image

HTML:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
      <style>
          body {  font-family:Calibri;
          }
          p {  margin-bottom: 15px;
          }
      </style>
  </head>
  <body>
    <p>Testing the empty paragraphs for spacing.</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>two empty paragraphs before this</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>three empty paragraphs before this</p>
  </body>
</html>
@uladzimirvysotski
Copy link

uladzimirvysotski commented Oct 10, 2024

Hi, why empty paragraphs?

Maybe you should try something else, like <br> ?

@mjefim
Copy link
Author

mjefim commented Oct 11, 2024

The HTML is the output of a WSIWYG editor, so I can not fully control the HTML in advance. I guess it could be possible to replace it the empty paragraph with the line break but I would rather keep the preprocessing to a minimum. Is there another solution perhaps?

@uladzimirvysotski
Copy link

You always can contribute :)

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

3 participants
@mjefim @uladzimirvysotski and others