1.0.4-29 • Published 3 years ago

@gerhobbelt/markdown-it-abbr v1.0.4-29

Weekly downloads
75
License
MIT
Repository
github
Last release
3 years ago

markdown-it-abbr

Build Status NPM version Coverage Status

Abbreviation (<abbr>) tag plugin for markdown-it markdown parser.

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

Markup is based on php markdown extra definition, but without multiline support.

Markdown:

*[HTML]: Hyper Text Markup Language
*[W3C]:  World Wide Web Consortium
The HTML specification
is maintained by the W3C.

HTML:

<p>The <abbr title="Hyper Text Markup Language">HTML</abbr> specification
is maintained by the <abbr title="World Wide Web Consortium">W3C</abbr>.</p>

Install

node.js, browser:

npm install @gerhobbelt/markdown-it-abbr --save

Use

var md = require('@gerhobbelt/markdown-it')()
            .use(require('@gerhobbelt/markdown-it-abbr'));

md.render(/*...*/); // See examples above

Pass a JSON list of abbr definitions

var abbrDefList = {
    "HTML": "Hyper Text Markup Language",
    "W3C": "World Wide Web Consortium"
};

var md = require('markdown-it')()
            .use(require('markdown-it-abbr'), abbrDefList);

md.render(/*...*/) // see example above

The list will be merged with the reference style abbreviation definitions like *[HTML]: Hyper Text Markup Language inside the markdown files (file definitions overwrite existing list definitions by default). To let list definitions overwrite existing definitions in the markdown file instead, pass a third argument listPriorsFile with true:

var md = require('markdown-it')()
            .use(require('markdown-it-abbr'), abbrDefList, true);

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

License

MIT

1.0.4-29

3 years ago

1.0.4-28

3 years ago

1.0.4-27

3 years ago

1.0.4-26

3 years ago

1.0.4-25

3 years ago

1.0.4-24

3 years ago

1.0.4-22

4 years ago

1.0.4-23

4 years ago

1.0.4-21

4 years ago

1.0.4-20

4 years ago

1.0.4-19

4 years ago

1.0.4-18

4 years ago

1.0.4-17

4 years ago

1.0.4-16

4 years ago

1.0.4-15

4 years ago

1.0.4-14

4 years ago

1.0.4-13

4 years ago

1.0.4-12

7 years ago