logseq/mldoc

org parser (as ran in js runtime) errors out

jobez opened this issue · 5 comments

jobez commented

Howdy,

First, thanks for sharing this project as well as logseq. I was having issues pulling in my journal file from last year.

I tried running the html converter in this parser on it and it got:

Parsing file...
tex/mldoc/js/package/index.js:1026
aO(a,b){if(a){var
^
RangeError: Maximum call stack size exceeded

The dimensions of the file are:
42092 lines, 590099 words, and 4006146 characters.

(Roughly) splitting it in half still had the same error, but splitting it into quarters seems to resolve the issue

@jobez hey, thanks!
I haven't notice this bug before, I guess it's because my files are shorter.
It might be related to some recursive rules when parsing inlines or blocks, it'll help a lot if there's some text that can be used to reproduce this issue.

jobez commented

kk, here's an masked version of the journal file. https://gist.github.com/jobez/9ae5ec95b0dae2467a40da3fec6a489e
this obscures some of the org syntax but still fails out with

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

@jobez Thanks, this can helps a lot! I'll give it a test soon.

@jobez It should be fixed now.
image

@jobez Closing it now, let me know if it doesn't work for you.