Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import React from 'react';
import defaultParserInterface from '../utils/defaultParserInterface';
import pkg from 'remark/package.json';
const ID = 'remark';
export default {
...defaultParserInterface,
id: ID,
displayName: ID,
version: pkg.version,
homepage: pkg.homepage,
locationProps: new Set(['position']),
loadParser(callback) {
require(['remark'], callback);
},
parse(remark, code, options) {
return remark()
.data('settings', options)
.parse(code);
},
nodeToRange({position}) {
if (position) {
return [position.start.offset, position.end.offset];
}