nim-markdown icon indicating copy to clipboard operation
nim-markdown copied to clipboard

javascript support

Open bluenote10 opened this issue 5 years ago • 4 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: https://github.com/nim-lang/Nim/issues/7640

bluenote10 avatar Jan 22 '19 22:01 bluenote10

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

Willyboar avatar May 15 '21 17:05 Willyboar

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 avatar May 15 '21 19:05 pietroppeter

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

pietroppeter avatar May 15 '21 19:05 pietroppeter

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.

soasme avatar May 15 '21 22:05 soasme