remark-code-extra icon indicating copy to clipboard operation
remark-code-extra copied to clipboard

remark@next (13)

Open wooorm opened this issue 5 years ago • 5 comments

Hi!

remark is switching to a new parser internally (micromark, see remarkjs/remark#536 for more info). From a quick glance at the code, it seems this plugin should be fine. However, it would be good to check that in the future (there is 13.0.0-alpha.0 published now, and one or two more will come before the release)

wooorm avatar Oct 03 '20 15:10 wooorm

@woorm This code is being shipped as commonjs at npm. The npm code unfortunately trips up Rollup with error message:

The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten
13:     if (!options_1.validateOptions(options))
14:         throw new Error('Invalid options');
15:     const transformer = (tree, _file) => __awaiter(this, void 0, void 0, function* () {
                                                       ^
16:         let transformations = [];
17:         visit(tree, 'code', node => {

It appears that this has to do with the conversion of async fn using generators and is not a problem of the code itself.

CxRes avatar Aug 23 '21 14:08 CxRes

I don’t think I can do anything about that though?

wooorm avatar Aug 23 '21 15:08 wooorm

Just FYI!!!!

Also warns other users that it may not be usable if you use ES Modules!!!

CxRes avatar Aug 23 '21 15:08 CxRes

I don't maintain or use this package?

wooorm avatar Aug 23 '21 15:08 wooorm

From a quick glance at the code, it seems this plugin should be fine. However, it would be good to check that in the future

Just an response to that (ie plugin is not fine). Ignore it if you find it unnecessary information (maintainer is obviously MIA).

CxRes avatar Aug 23 '21 15:08 CxRes