Skip to content

Commit

Permalink
support multiple output formats cjs, umd and esm
Browse files Browse the repository at this point in the history
  • Loading branch information
nagaozen committed May 25, 2019
1 parent 49af888 commit 0af188e
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dist/markdownItAnchor.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/markdownItAnchor.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions dist/markdownItAnchor.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
var n={false:"push",true:"unshift"},e=Object.prototype.hasOwnProperty,r=function(n,t){t=Object.assign({},r.defaults,t),n.core.ruler.push("anchor",function(n){var r,i={},u=n.tokens,o=Array.isArray(t.level)?(r=t.level,function(n){return r.includes(n)}):function(n){return function(e){return e>=n}}(t.level);u.filter(function(n){return"heading_open"===n.type}).filter(function(n){return o(Number(n.tag.substr(1)))}).forEach(function(r){var o=u[u.indexOf(r)+1].children.filter(function(n){return"text"===n.type||"code_inline"===n.type}).reduce(function(n,e){return n+e.content},""),c=r.attrGet("id");null==c&&(c=function(n,r){for(var t=n,i=2;e.call(r,t);)t=n+"-"+i++;return r[t]=!0,t}(t.slugify(o),i),r.attrPush(["id",c])),t.permalink&&t.renderPermalink(c,t,n,u.indexOf(r)),t.callback&&t.callback(r,{slug:c,title:o})})})};r.defaults={level:1,slugify:function(n){return encodeURIComponent(String(n).trim().toLowerCase().replace(/\s+/g,"-"))},permalink:!1,renderPermalink:function(e,r,t,i){var u,o=[Object.assign(new t.Token("link_open","a",1),{attrs:[["class",r.permalinkClass],["href",r.permalinkHref(e,t)],["aria-hidden","true"]]}),Object.assign(new t.Token("html_block","",0),{content:r.permalinkSymbol}),new t.Token("link_close","a",-1)];r.permalinkSpace&&o[n[!r.permalinkBefore]](Object.assign(new t.Token("text","",0),{content:" "})),(u=t.tokens[i+1].children)[n[r.permalinkBefore]].apply(u,o)},permalinkClass:"header-anchor",permalinkSpace:!0,permalinkSymbol:"¶",permalinkBefore:!1,permalinkHref:function(n){return"#"+n}};export default r;
//# sourceMappingURL=markdownItAnchor.mjs.map
1 change: 1 addition & 0 deletions dist/markdownItAnchor.mjs.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions dist/markdownItAnchor.umd.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/markdownItAnchor.umd.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0af188e

Please sign in to comment.