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

rewrite parsing of auspiceMainDisplayMarkdown; #1189

Merged
merged 1 commit into from
Jul 21, 2020

Conversation

eharkins
Copy link
Contributor

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.

use 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, "```".
@eharkins eharkins requested review from jameshadfield and trvrb July 21, 2020 03:24
@jameshadfield jameshadfield temporarily deployed to auspice-maindisplaymark-ppccfa July 21, 2020 03:24 Inactive
@jameshadfield
Copy link
Member

Thanks @eharkins -- tested & confirm that it fixes the problematic narrative with no obvious changes to the others i've tested on. I enjoyed learning more about regex's through this!

Going forward, I consider it a high priority to merge #1172 which I'll endeavor to do in the next day or so. If you wouldn't mind checking that out with the knowledge you gained from this PR, that would be wonderful!

@jameshadfield jameshadfield merged commit 17f8b48 into master Jul 21, 2020
@jameshadfield jameshadfield deleted the MainDisplayMarkdown-parse branch July 21, 2020 04:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants