LukeSmithxyz / lb

Blog & RSS system in less than 100 lines of shell script
GNU General Public License v3.0
280 stars 81 forks source link

When inserting <div> </div> into blog entry, it mucks up the rolling view page #39

Closed QDesjardin closed 2 years ago

QDesjardin commented 4 years ago

Say for example, if you wanted to format an embed YouTube video, or want to put a special section like so:

<div class="video-container">
   ...
</div>

What happens is that after you publish it, in rolling view, the entry is duplicated outside the blog post bounds:

pic-select-202007-1812-20

with the page source looking like this:

<div class='entry'>
aaa
<div class="video-container">
  bbb
</div>

ccc
</div>

aaa
<div class="video-container">
  bbb
</div>

ccc
</div>

I suspect the lb script relies on using </div> (as a line by itself) to delineate the entries between blog posts, but when you manually put in </div> in the entry, the script is confused. This does not happen if <div> and </div> are on the same line. One workaround is using something like

<section id="blablabla"> 
    insert stuff here
</section>

where this issue is avoided entirely.

ludovici-philippus commented 2 years ago

I think I know a way to fix it. If the lb script really relies on using </div> to delineate the entries, so if you change it to a personal tag, like <entry> </entry> it would be fixed, and divs could be used into blog entry