sillsdev / ptx2pdf

XeTeX based macro package for typesetting USFM formatted (Paratext output) scripture files
23 stars 8 forks source link

"orphan marker" crash in diglot-merging with p^95 syntax with \x #879

Closed davidg-sil closed 10 months ago

davidg-sil commented 1 year ago

I don't fully understand what the SFM parser is trying to do when it bails out moaning about "orphaned marker", but the sequence \m^95 ..... \x + \xt ...\x* crashes the parser. It seems that the parser is trying to determine the type of \m^95, does not find it in the stylesheet (obviously) or (fully?) recognise it as a paragraph type that might contain the \x, a knows that \x needs containing, and throws the error.

Here is a the result of using the stand-alone merge tool:

path/to/file.SFM: line 170,7 [id c m^95]: orphan marker \x
Traceback (most recent call last):
  File "python/scripts/usfmerge", line 55, in <module>
    usfmerge2(args.infile, keyarr, args.outfile, stylesheets=stylesheets, stylesheetsa=sheetsa,stylesheetsb=sheetsb, scorearr=scorearr,
  File "python/lib/ptxprint/usfmerge.py", line 1069, in usfmerge2
    doc = list(usfm.parser(inf, stylesheet=sheets[colkey],
  File "python/lib/ptxprint/sfm/__init__.py", line 742, in _default_
    self._error(ErrorLevel.Unrecoverable,
  File "python/lib/ptxprint/sfm/__init__.py", line 607, in _error
    raise SyntaxError(msg)
SyntaxError: path/to/file.SFM: line 170,7 [id c m^95]: orphan marker \x
markpenny commented 11 months ago

@mhosken I think Bob E was also seeing something like this happening during the workshop last week.