Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SOFRIA export fails with verse straddling partial paragraph preceded by note. #150

Open
mvahowe opened this issue Oct 12, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@mvahowe
Copy link
Owner

mvahowe commented Oct 12, 2022

Some USX, when rendered as SOFRIA, throws the following error:

TypeError: Cannot read property 'push' of undefined
    at e.exports.action (/home/mark/repos/proskomma-js/dist/index.js:121:56362)
    at e.exports.renderEvent (/home/mark/repos/proskomma-js/dist/index.js:8:115328)
    at e.exports.renderItem (/home/mark/repos/proskomma-js/dist/index.js:121:46054)
    at e.exports.renderContent (/home/mark/repos/proskomma-js/dist/index.js:121:44829)
    at e.exports.renderSequence (/home/mark/repos/proskomma-js/dist/index.js:121:44628)
    at e.exports.renderDocument1 (/home/mark/repos/proskomma-js/dist/index.js:121:42927)
    at e.exports.renderDocument (/home/mark/repos/proskomma-js/dist/index.js:8:114742)
    at Xa.sofria (/home/mark/repos/proskomma-js/dist/index.js:121:308821)
    at Object.sofria (/home/mark/repos/proskomma-js/dist/index.js:121:354468)
    at Xu (/home/mark/repos/proskomma-js/dist/index.js:121:258849)

I managed to replicate the error with some short USX fragments. The error seems to happen when a verse started in one paragraph ends halfway through another paragraph, and when the first paragraph also contains a note. (Both these conditions must be true to see the error.)

sofria_works_usx.txt
sofria_also_works_usx.txt
sofria_no_works_usx.txt
sofria_this_no_works_neither_usx.txt

@mvahowe mvahowe added the bug Something isn't working label Oct 12, 2022
@mvahowe
Copy link
Owner Author

mvahowe commented Oct 12, 2022

The PERF endpoint works with all those test files, so the problem appears to be specific to SOFRIA export.

@mvahowe
Copy link
Owner Author

mvahowe commented Oct 12, 2022

I made ProskommaRender errors more informative:

Error: Exception from action 'identity' for event startWrapper: Error: outputContentStack is empty before pushing to its first element

So it looks like a stack management thing.

@mvahowe
Copy link
Owner Author

mvahowe commented Oct 12, 2022

My previously failing tests now pass. The issue was that I was clearing the chapter and verse state at the end of every sequence, when in fact this should only happen at the end of the main sequence.

@mvahowe
Copy link
Owner Author

mvahowe commented Oct 12, 2022

Made a PR to proskomma-json-tools. Once that has been merged we'll refresh that module in Proskomma, which ought to fix the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant