J2M icon indicating copy to clipboard operation
J2M copied to clipboard

Unfinished inline citation (?? something) hangs the script

Open hazzik opened this issue 7 years ago • 8 comments

hazzik avatar Oct 16 '17 21:10 hazzik

Could you provide an example?

FokkeZB avatar Oct 17 '17 05:10 FokkeZB

Just go to the website and type “?? Anything” On Tue, 17 Oct 2017 at 6:50 PM, Fokke Zandbergen [email protected] wrote:

Could you provide an example?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/FokkeZB/J2M/issues/31#issuecomment-337124966, or mute the thread https://github.com/notifications/unsubscribe-auth/AAI1l85zgUMbVEeH0SGTFETCbu0omrNKks5stEA6gaJpZM4P7S66 .

hazzik avatar Oct 17 '17 05:10 hazzik

Sorry, can't reproduce hanging the script:

FokkeZB avatar Oct 17 '17 06:10 FokkeZB

I'm able to reproduce this constantly. Thee are several conditions:

  • ?? shall be at the beginning of a line
  • It shall be not at the end of the file ezgif-3-255a5087d6 1

hazzik avatar Oct 17 '17 07:10 hazzik

Easiest way to reproduce is

  1. Open http://j2m.fokkezb.nl/
  2. On line 15 select "citation??" (without first ??")
  3. Press "delete"/"backspace"

hazzik avatar Oct 17 '17 07:10 hazzik

I can constantly reproduce this in latest Chrome and Firefox on Windows 10 and MacOS and on node 8.7 It does not hang in Safari and Mobile Safari

hazzik avatar Oct 17 '17 07:10 hazzik

Yep, with that I can reproduce, so it seems the issue is related to other stuff in the editor as well.

Unfortunately it indeed hangs, with no logs to aid debugging it further.

I'm also kind of iceboxing this project. If you have time to dig in and send a PR that would be appreciated.

FokkeZB avatar Oct 17 '17 07:10 FokkeZB

The culprit is at regex which parses the citation.

hazzik avatar Oct 17 '17 07:10 hazzik