If a christian tells me `that's might "christian" of you`, I can only consider that a compliment. Thank you very much!
I think I fixed it. When there was a nested part (like in this case), I would split it in a head, the nested part and a tail and parse these three parts separately. I changed that to first parse the nested part (recursively) and replace the text with the output of the parse function before parsing the whole text. That means that the nested part gets parsed (at least) twice but during the last run it should not contain any backslashes or braces so it shouldn't matter. Jn 3:13 seems to be handled correctly now.
Could you please try the modified script? If it works correctly I will replace the zip file in the original post.
To all the non-IT readers of this thread, sorry for the jargon. I found a colleague
Tested today. Your fix seems to have nailed it. Not only does it deal with the nested tags properly it now runs much faster. In fact it runs so fast now I thought it was broken. When I used to old program it took about 10 minutes to parse a bible file this latest version takes maybe 10 seconds.
John 3:13 looks good along with other texts with nested tags like John 4:24 , John 4:35 John 2:8 etc. So far I have found no issues. I'll update you if I do.
Thanks again. You've changed a pretty good bible app into a fantastic one for me.
I appreciate the update and the explanation of your fix.