seven1m / bible_api

Ruby web app that serves JSON API for open and public domain bibles
https://bible-api.com
MIT License
568 stars 104 forks source link

Exodus 1:1 kjv has a newline in the middle of it #32

Open Zachiah opened 4 years ago

Zachiah commented 4 years ago

go to http://bible-api.com/Exodus+1:1?translation=kjv and it has a random newline in the middle

seven1m commented 4 years ago

I'd noticed that before; it comes from the source material which is in the file eng-kjv.osis.xml here: https://github.com/seven1m/open-bibles/

<verse osisID="Exod.1.1" sID="Exod.1.1.seID.01585" n="1" />Now these
<transChange type="added">are</transChange> the names of the children of Israel, which came into Egypt; every man and his household came with Jacob.

I think it would be safe to strip newlines from the XML during parsing. I'll see about doing that.

Thanks for the bug report!

Zachiah commented 4 years ago

Thank you you might be able to just replace all whitespace with a space because john 3:16 kjv for example also starts with a margin

Zachiah commented 4 years ago

for now I'll just use text.strip.gsub("\n"," ") in my rails app

seven1m commented 4 years ago

Extra examples:

abbasou commented 4 months ago

Coming back to this as I've found many, many examples of this in the KJV. Attempting to use Obsidian Bible Reference plugin, but output formatting is almost unusable. Will open issue over there to see if there is a fix post-api call, but would be nice to fix it on the source side I would think.