View Single Post
Old 11-24-2022, 09:44 AM   #3
MgHar
Junior Member
MgHar began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Nov 2022
Device: Kobo Forma
Auto-add <br/> tag in every blank line (follow up)

Thanks for your reply theducks, I really appreciate you taking time to help with this. I tried adding a margin-top:1em; to the P class as suggested.

First let me explain what I'm trying to achieve (I realize that my initial post was not clear):

In Calibre's Editor :
  1. I create a blank ePub book
  2. Then I paste text within a <p></p> tag (the text might be 50 to 100 pages long, divided in hundreds of paragraphs)

The immediate result (visible in the preview pane of the editor) is that the text loses its paragraphs (which is normal with a p tag) BUT the text will dynamically auto-adjust the wrapping, regardless of the e-reader settings (that's an essential upside) (please see Capture 1 file attached).

Notice that when I pasted the text, empty lines appear between each paragraph (lines 14, 16 and 18)

The only way that I found to keep the "auto-wrap" WITHIN each paragraph AND achieve paragraph separation, is to add a double <br/> tag to each blank line.

In Capture 2 you'll see that I've added "<br/><br/>" to lines 14, 16 and 18. The result is visible in the preview pane. The paragraphs are now separated AND if I adjust the preview pane width, the wrapping will auto-adjust perfectly, and the paragraphs will remain separated. That's the result I'm looking for.

If my texts had only 10-20 paragraphs, I would add the <br/> tags manually. BUT with hundreds of paragraphs, the process juste becomes too much.

So there you have it, this is the purpose of my posting.

As mentioned at the beginning of this post I tried adding a margin-top:1em; to the P class as suggested. If you take a look at Capture 3, the text remains a big block with no paragraph separation.

My idea was to find a way to "auto-add" the "<br/><br/>" tags to every empty line. I'm a newbie to html, so perhaps there is a better way to achieve the same result.

Thanks for your help

Click image for larger version

Name:	Capture 1.png
Views:	147
Size:	537.2 KB
ID:	197977

Click image for larger version

Name:	Capture 2.png
Views:	210
Size:	545.1 KB
ID:	197978

Click image for larger version

Name:	Capture 3.png
Views:	121
Size:	557.2 KB
ID:	197979
MgHar is offline   Reply With Quote