Skip to content

Commit

Permalink
Fixed a bug that caused subsequent id tags to be skipped
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnAustinDev committed Nov 30, 2016
1 parent f193760 commit ad7fbad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bin/usfm2osis.py
Expand Up @@ -438,7 +438,7 @@ def cvtIdentification(osis, relaxedConformance):
"""

# \id_<CODE>_(Name of file, Book name, Language, Last edited, Date etc.)
osis = re.sub(r'\\id\s+([A-Z0-9]{3})\b\s*([^\\'+'\n]*?)\n'+r'(.*)(?=\\id|$)', lambda m: '\uFDD0<div type="book" osisID="' + bookDict[m.group(1)] + '"' + (' canonical="true"' if bookDict[m.group(1)] not in specialBooks else '') + '>\n' + (('<!-- id comment - ' + m.group(2) + ' -->\n') if m.group(2) else '') + m.group(3) + '</div type="book">\uFDD0\n' , osis, flags=re.DOTALL)
osis = re.sub(r'\\id\s+([A-Z0-9]{3})\b\s*([^\\'+'\n]*?)\n'+r'(.*?)(?=\\id|$)', lambda m: '\uFDD0<div type="book" osisID="' + bookDict[m.group(1)] + '"' + (' canonical="true"' if bookDict[m.group(1)] not in specialBooks else '') + '>\n' + (('<!-- id comment - ' + m.group(2) + ' -->\n') if m.group(2) else '') + m.group(3) + '</div type="book">\uFDD0\n' , osis, flags=re.DOTALL)

# \ide_<ENCODING>
osis = re.sub(r'\\ide\b.*'+'\n', '', osis) # delete, since this was handled above
Expand Down

0 comments on commit ad7fbad

Please sign in to comment.