Skip to content

Commit

Permalink
Implicit figures (#35)
Browse files Browse the repository at this point in the history
* fix typography test

* add plugin before linkify

plugin markdown-it-implicit-figures is added before linkify,
so to assure that attrs plugin is added before implicit-figures
.use() attrs first, then implicit-figures:

md.use(attrs).use(implicitFigures)

ref: arve0/markdown-it-implicit-figures#18

* output in runkit.com is last line, fix demo
  • Loading branch information
arve0 committed May 19, 2017
1 parent 633132a commit 273c73c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 1 addition & 3 deletions demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,4 @@ md.use(markdownItAttrs);
var src = '# header {.style-me}\n';
src += 'paragraph {data-toggle=modal}';

var res = md.render(src);

console.log(res); // eslint-disable-line
md.render(src);
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ module.exports = function attributes(md) {

}
}
md.core.ruler.before('replacements', 'curly_attributes', curlyAttrs);
md.core.ruler.before('linkify', 'curly_attributes', curlyAttrs);
};

/**
Expand Down
3 changes: 2 additions & 1 deletion test.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ describe('markdown-it-attrs', () => {
it('should work with typography enabled', () => {
src = 'text {key="val with spaces"}';
expected = '<p key="val with spaces">text</p>\n';
assert.equal(md.render(src), expected);
var res = md.set({ typographer: true }).render(src);
assert.equal(res, expected);
});

it('should support code blocks', () => {
Expand Down

0 comments on commit 273c73c

Please sign in to comment.