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

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 are deleted.
This commit is contained in:
Joe Standring 2019-06-01 16:21:44 +00:00 committed by GitHub
parent aae34619cc
commit 87b6c68664
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

2
lb
View File

@ -57,7 +57,7 @@ confirm() { read -erp "Really $1 \"$base\"? (y/N) " choice && echo "$choice" | g
delete() { \
sed -i "/<item/{:a;N;/<\\/item>/!ba};/#$base.html<\\/guid/d" $rssfile
sed -i "/<div/{:a;N;/<\\/div>/!ba};/id='$base'/d" $blogfile
sed -i "/<div class='entry'>/{:a;N;/<\\/div>/!ba};/id='$base'/d" $blogfile
sed -i "/<li>.*<a href=\"blog\\/$base.html\">/d" $indexfile
rm "$webdir/blog/$basefile" 2>/dev/null && printf "Old blog entry removed.\\n" ;}