Giter Club home page Giter Club logo

remark-mark-plus's Introduction

remark-mark-plus

This plugin parses ==custom Markdown syntax== to the HTML <mark> element. It adds a new node type to the mdast produced by remark: mark

If you are using rehype, the stringified HTML result will be <mark>.

Syntax

Click ==File > Open== to open the file.

AST (see mdast specification)

Mark (Parent) represents a reference to a user.

interface Mark <: Parent {
  type: "mark";
}

For example, the following markdown:

==File > Open==

Yields:

{
  type: 'mark',
  children: [{
    type: 'text',
    value: 'File > Open'
  }]
}

Rehype

This plugin is compatible with rehype. Mark mdast nodes will become <mark>contents</mark>.

Installation

npm:

npm install remark-mark-plus

Usage

Dependencies:

const unified = require('unified')
const remarkParse = require('remark-parse')
const stringify = require('rehype-stringify')
const remark2rehype = require('remark-rehype')

const remarkMark = require('remark-mark-plus')

Usage:

unified()
  .use(remarkParse)
  .use(remarkMark)
  .use(remark2rehype)
  .use(stringify)

License

MIT © [Zeste de Savoir][zds]

remark-mark-plus's People

Contributors

twardoch avatar

Stargazers

Maksim Stashkevich avatar Zach Green avatar Alex Titarenko avatar

Watchers

 avatar James Cloos avatar  avatar

remark-mark-plus's Issues

Errors with the latest react-markdown

When using "react-markdown": "^9.0.0",

import ReactMarkdown from "react-markdown";
import markPlus from "remark-mark-plus";
<ReactMarkdown remarkPlugins={[markPlus]}/>{text}</ReactMarkdown>

throws an error:

Unhandled Runtime Error
TypeError: Cannot read properties of undefined (reading 'prototype')

Call Stack
Function.plugin
../../node_modules/remark-mark-plus/dist/index.js (56:0)

Still maintained? errors

Hello

I was just wondering if this package was still maintained?

I was trying to use it from MDX, and got the following errors:

Cannot read properties of undefined (reading 'inlineTokenizers')

I cloned the repo, tried to run the tests, to no avail unfortunately:

npm run test  

> [email protected] test
> jest

 FAIL  __tests__/index.js
  ● Test suite failed to run

    TypeError: /Users/sebastien.barre/Development/Src/playground/remark-mark-plus/__tests__/index.js: Cannot read properties of null (reading 'bindings')

      at Scope.moveBindingTo (node_modules/@babel/traverse/lib/scope/index.js:993:13)
      at BlockScoping.updateScopeInfo (node_modules/babel-plugin-transform-es2015-block-scoping/lib/index.js:364:17)
      at BlockScoping.run (node_modules/babel-plugin-transform-es2015-block-scoping/lib/index.js:330:12)
      at PluginPass.BlockStatementSwitchStatementProgram (node_modules/babel-plugin-transform-es2015-block-scoping/lib/index.js:70:24)
      at newFn (node_modules/@babel/traverse/lib/visitors.js:177:21)
      at NodePath._call (node_modules/@babel/traverse/lib/path/context.js:53:20)
      at NodePath.call (node_modules/@babel/traverse/lib/path/context.js:40:17)
      at NodePath.visit (node_modules/@babel/traverse/lib/path/context.js:100:31)
      at TraversalContext.visitQueue (node_modules/@babel/traverse/lib/context.js:103:16)
      at TraversalContext.visitSingle (node_modules/@babel/traverse/lib/context.js:77:19)

Test Suites: 1 failed, 1 total
Tests:       0 total
Snapshots:   0 total
Time:        0.26 s

Thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.