soasme / nim-markdown

A Beautiful Markdown Parser in the Nim World.
https://www.soasme.com/nim-markdown/
MIT License
152 stars 11 forks source link

javascript support #19

Open bluenote10 opened 5 years ago

bluenote10 commented 5 years ago

My plan was to use nim-markdown within a Karax app (js target), but compilations fails with:

../../../bin/nim-repo/lib/impure/re.nim(100, 3) Error: undeclared identifier: 'copyMem'

It looks like js support is currently blocked by this: https://github.com/nim-lang/Nim/issues/7640

Willyboar commented 3 years ago

@soasme Any plan on supporting js compile in the near future?

pietroppeter commented 3 years ago

I would be interested too. It should not be too difficult, the obstacle should be only module re which is not available in js backend (depends on PCRE). If sometime ago I would have said we could use jsre, now I would probably try with nim-regex, which received a lot of endorsements recently (it might end up in "stdlib" through the bundler and is now accepted - by Araq nonetheless - as the better regular expression module).

pietroppeter commented 3 years ago

On the other hand for JS backend a wrapper for a markdown library (eg markdown-it) would also probably make sense.

soasme commented 3 years ago

I have been looking into module jsre; the most difficult thing is it has a completely different API with re module. I'll take a look into nim-regex and see if it can solve the problem.

I can see the value nim-markdown can be compiled to javascript as a backend. Will definitely add it to the roadmap.