markdown-it-attrs
Advanced tools
Comparing version 2.1.0 to 2.2.0
@@ -1,2 +0,2 @@ | ||
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.markdownItAttrs = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | ||
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.markdownItAttrs = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){ | ||
'use strict'; | ||
@@ -467,2 +467,34 @@ | ||
/** | ||
* horizontal rule --- {#id} | ||
*/ | ||
name: 'horizontal rule', | ||
tests: [{ | ||
shift: 0, | ||
type: 'paragraph_open' | ||
}, { | ||
shift: 1, | ||
type: 'inline', | ||
children: function children(arr) { | ||
return arr.length === 1; | ||
}, | ||
content: function content(str) { | ||
return str.match(/^ {0,3}[-*_]{3,} {0,1}\{[^{]/) !== null; | ||
} | ||
}, { | ||
shift: 2, | ||
type: 'paragraph_close' | ||
}], | ||
transform: function transform(tokens, i) { | ||
var token = tokens[i]; | ||
token.type = 'hr'; | ||
token.tag = 'hr'; | ||
token.nesting = 0; | ||
var content = tokens[i + 1].content; | ||
var start = content.lastIndexOf('{'); | ||
token.attrs = utils.getAttrs(content, start, options); | ||
token.markup = content; | ||
tokens.splice(i + 1, 2); | ||
} | ||
}, { | ||
/** | ||
* end of {.block} | ||
@@ -761,2 +793,2 @@ */ | ||
},{}]},{},[1])(1) | ||
}); | ||
}); |
{ | ||
"name": "markdown-it-attrs", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"description": "Add classes, identifiers and attributes to your markdown with {} curly brackets, similar to pandoc's header attributes", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -265,2 +265,34 @@ 'use strict'; | ||
/** | ||
* horizontal rule --- {#id} | ||
*/ | ||
name: 'horizontal rule', | ||
tests: [ | ||
{ | ||
shift: 0, | ||
type: 'paragraph_open' | ||
}, | ||
{ | ||
shift: 1, | ||
type: 'inline', | ||
children: (arr) => arr.length === 1, | ||
content: (str) => str.match(/^ {0,3}[-*_]{3,} {0,1}\{[^{]/) !== null | ||
}, | ||
{ | ||
shift: 2, | ||
type: 'paragraph_close' | ||
} | ||
], | ||
transform: (tokens, i) => { | ||
let token = tokens[i]; | ||
token.type = 'hr'; | ||
token.tag = 'hr'; | ||
token.nesting = 0; | ||
let content = tokens[i + 1].content; | ||
let start = content.lastIndexOf('{'); | ||
token.attrs = utils.getAttrs(content, start, options); | ||
token.markup = content; | ||
tokens.splice(i + 1, 2); | ||
} | ||
}, { | ||
/** | ||
* end of {.block} | ||
@@ -267,0 +299,0 @@ */ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
50742
1503