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

Made delete() safer with <!-- LB --> inside divs #20

Closed hollystandring closed 5 years ago

hollystandring commented 5 years ago

Previously when using delete() with <!-- LB --> inside div tags, the tags it was placed in also got deleted, meaning a bunch of non-blog content was deleted too. By specifying <div class='entry'>, only the div tags containing blog entries (<div class='entry'>) are deleted.

In other words, using the function on a $blogfile containing something like:

<div class="content">
<h1>My Blog</h1>
<!-- LB -->
<div class='entry'>
...
</div>
</div>

Would result in the entire <div class="content"> tag and contents being deleted.

LukeSmithxyz commented 5 years ago

Thanks for this one. I guess in my use case I never ran across it.