summaryrefslogtreecommitdiff
path: root/md.sh
diff options
context:
space:
mode:
Diffstat (limited to 'md.sh')
-rwxr-xr-xmd.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/md.sh b/md.sh
index 90f94c4..522300f 100755
--- a/md.sh
+++ b/md.sh
@@ -135,6 +135,15 @@ cat $tmp | while IFS='' read -r data ; do
# find old id in output, replace with new id
IDLINE=$(grep -ne "^<h[[:digit:]] id=" $OUT | fzy -e "$(echo $HEADER | unesc)" | head -n 1 | cut -f 1 -d :) ;
+ if [ "$HEADER" = "<ul>" ] ; then
+ IDLINE="" ;
+ fi ;
+ if [ "$HEADER" = "</ul></li>" ] ; then
+ IDLINE="" ;
+ fi ;
+ if [ "$HEADER" = "</ul>" ] ; then
+ IDLINE="" ;
+ fi ;
if [ "$IDLINE" ] ; then
sed "${IDLINE}s;id=\".*\">.*</h;id=\"${ID}\">${HEADER}</h;" -i'' $OUT ;
printf "\tassembled header: %s\n" "$(echo $HEADER | unesc)" ;