markdown-it-synapse
TypeScript icon, indicating that this package has built-in type declarations

1.1.14 • Public • Published

markdown-it-synapse

GitHub Actions Workflow Status NPM version

Synapse tag plugin for markdown-it markdown parser.

v1.+ requires markdown-it v4.+, see changelog.

${image?fileName=joy%2Epng&align=None} => <span id="widget-0my-unique-div-id" class="widgetContainer" widgetparams="image?fileName=joy%2Epng&amp;align=None" />

Install

node.js, browser:

npm install markdown-it-synapse --save
bower install markdown-it-synapse --save

Use

import markdownit from 'markdown-it'
import markdownitSynapse from 'markdown-it-synapse'

const md = new markdownit()
md.use(markdownitSynapse)

md.render('${image?fileName=joy%2Epng&align=None}', 'my-unique-div-id') // => '<span id="widget-0my-unique-div-id" class="widgetContainer" widgetparams="image?fileName=joy%2Epng&amp;align=None" />'

The widgetparams can be used to determine what kind of html widget should be rendered in the output container.

Differences in browser. If you load script directly into the page using the IIFE bundle, without package system, module will add itself globally as window.markdownitSynapse.

License

MIT

Package Sidebar

Install

npm i markdown-it-synapse

Weekly Downloads

400

Version

1.1.14

License

MIT

Unpacked Size

29.7 kB

Total Files

8

Last publish

Collaborators

  • jay-hodgson
  • xschildwachter
  • agendel
  • nickgros
  • roccbot