rewrite parsing of auspiceMainDisplayMarkdown; #1189
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See https://bedfordlab.slack.com/archives/C116R9PR7/p1595292741008800
This uses string.split instead of regex, which was causing browser to hang (possibly due to https://www.regular-expressions.info/catastrophic.html) despite technically valid paragraph missing both the opening string, "```auspiceMainDisplayMarkdown", and the closing string, "```".
There are many other regexes in the narrative parsing function so this doesn't necessarily prevent the same or similar issues in the future. Maybe there is a way to wrap the whole function to handle any hanging regexes.
Testing
Just tested that the narratives in the auspice repo are correctly parsed and that the browser doesn't hang for the example narrative from slack.