soasme / nim-markdown

A Beautiful Markdown Parser in the Nim World.

Home Page:https://www.soasme.com/nim-markdown/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

javascript support

bluenote10 opened this issue · comments

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: nim-lang/Nim#7640

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

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).

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

commented

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.