LukeSmithxyz/lb

If a blog post page contains numerical digit(s), it can throw off revising a blog entry

QDesjardin opened this issue · 0 comments

One of my pages happens to be titled "Season 3 nostalgia," and I wanted to revise post 3, "Scary Dairy." This is what happens:

pic-select-202007-1554-02

Basically, nothing shows up in the text editor because lb has concatenated the titles of "Season 3 Nostalgia" with "Scary Dairy." This happens because of the command:

chosen="$(ls -rc "$1" -I '*[^".html"]' -I "index.html" | nl | grep -w " $number" | awk '{print $2}')"

where grep -w "$number" ends up selecting two pages at once:

pic-select-202007-1551-54

However, modifying the grep command to include a preceding space before $number: grep -w " $number" fixes the issue.