Skip to content

Commit

Permalink
explicity set processor in linkstrings (LanguageMachines/PICCL#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
proycon committed Oct 7, 2021
1 parent c8743df commit 15d5c8f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions foliatools/foliatextcontent.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def linkstrings(element, cls='current',debug=False):
print(" String refers to offset " + str(stringoffset) + ", but is not found there ! Found '" + subtext[reloffset:reloffset+length] + "' instead.",file=sys.stderr)
else:
#match!
kwargs = {}
kwargs = {'processor': element.doc.processor}
replaceindex = i
if string.id:
kwargs['idref'] = string.id
Expand Down Expand Up @@ -300,8 +300,8 @@ def addoffsets(element, textclass):
if not hasattr(parent, 'addoffsetcursor'):
parent.addoffsetcursor = 0
startoffset = parent.addoffsetcursor
elementtext = elementtextcontent.text()
parenttext = parenttextcontent.text()
elementtext = elementtextcontent.text().replace("\n", " ") #insensitive to newlines
parenttext = parenttextcontent.text().replace("\n", " ")
while parenttext[parent.addoffsetcursor:parent.addoffsetcursor+len(elementtext)] != elementtext:
parent.addoffsetcursor += 1
if parent.addoffsetcursor >= len(parenttext):
Expand Down

0 comments on commit 15d5c8f

Please sign in to comment.