JATS4R/validator

Syntax highlighter hangs on large files

Klortho opened this issue · 2 comments

After implementing the feature for #5, I found that when I give it a large XML file, the syntax highlighter, prism, hangs. I guess the easiest solution will be to disable syntax highlighting for files over a certain size.

Alf suggests trying https://highlightjs.org/

The problem wasn't in the syntax highlighter, after all. It was crashing in xmllint, because running out of memory. I modified an option to emcc, and now that is compiled with dynamic memory alloc.

I also refactored the code here, to make it more asyncronous, and put in a setTimeout call when starting a new phase, so that the display updates even when the JS is very busy. So, now, there's much better feedback to the user about what phase is actually running.