gnab / remark

A simple, in-browser, markdown-driven slideshow tool.
http://remarkjs.com
MIT License
12.67k stars 854 forks source link

remark with typescript #656

Closed 3axap4eHko closed 2 years ago

3axap4eHko commented 2 years ago

I'm using remark in typescript project and it throws an Error

Details:

    /home/zource/projects/zource/api/node_modules/remark/index.js:1
    ({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,jest){import {unified} from 'unified'
                                                                                      ^^^^^^

    SyntaxError: Cannot use import statement outside a module

    > 1 | import { remark } from 'remark';

code example

import { remark } from 'remark';
import remarkHTML from 'remark-html';

export default function(source: string) {
  return remark()
    .use(remarkHTML)
    .process(source);
}
tripu commented 2 years ago

What is remark().proces()? I don't recognise that method.

Also: typo there? (proces instead of process)?

3axap4eHko commented 2 years ago

@tripu it was a typo

3axap4eHko commented 2 years ago

@tripu why did you close the issue? The typo was only in the issue description lol

tripu commented 2 years ago

@tripu why did you close the issue? The typo was only in the issue description lol

@3axap4eHko: OK, sorry. Your response wasn't very clear.

But I understand now: you are using npm package remark, which is this tool, which (in spite of the name) has nothing to do with this project here.

Go here instead: https://github.com/remarkjs/remark/issues

3axap4eHko commented 2 years ago

Oh sorry about that 😄

moslem-parsarad-dev commented 1 year ago

just fix it.