selfire1 / BibleGateway-to-Obsidian

This script adapts jgclark's BibleGateway-to-Markdown script to export for use in Obsidian.
MIT License
204 stars 63 forks source link

Problem with books that have number or more than one word #43

Closed alexdicant closed 12 months ago

alexdicant commented 1 year ago

In the last update there are problems with books that start with a number or more than one word, that is, books that use quotation marks (").

I have checked in version b3663fba966549e196c20a5f0a275a7d941291ca of September 29, 2022 and it works, with some small problems, but it works.

The problem is from version 95d17cab07df0ad291b07e24ea74b71f436a6f8a onwards.

Lucas-Froguel commented 1 year ago

I think the issue is with the ruby code that reads the verses from internet. The solution I found was removing the blank spaces. I made a PR with that fix, but you can update line 220 with

book_no_spaces=$(echo "$book" | sed 's/ //g')
# Use the bg2md script to read chapter contents
chapter_content=$(ruby bg2md.rb $bg2md_flags -v $ARG_VERSION $book_no_spaces$chapter)
KardKibitzer commented 1 year ago

@Lucas-Froguel I'm also having this issue but know very little about scripting. Is the line update supposed to go in bg2md.rb or bg2obs.sh? Line 220 doesn't make sense to me for either of those.

C-r-y-p-t-i-d commented 1 year ago

I think the issue is with the ruby code that reads the verses from internet. The solution I found was removing the blank spaces. I made a PR with that fix, but you can update line 220 with

book_no_spaces=$(echo "$book" | sed 's/ //g')
# Use the bg2md script to read chapter contents
chapter_content=$(ruby bg2md.rb $bg2md_flags -v $ARG_VERSION $book_no_spaces$chapter)

Thank you brother, worked perfectly and saved me a lot of time! 🙏

Lucas-Froguel commented 12 months ago

I just made a PR that pushes the full solution to the main code. After that is approved, I believe this issue can be closed.

selfire1 commented 12 months ago

Closed with #47, thanks @Lucas-Froguel !