Skip to content

Commit

Permalink
2.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
arve0 committed Jun 9, 2018
1 parent 807730b commit fd42412
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 4 deletions.
36 changes: 34 additions & 2 deletions markdown-it-attrs.browser.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(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';

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
Expand Down Expand Up @@ -462,6 +462,38 @@ module.exports = function (options) {
utils.addAttrs(attrs, openingToken);
tokens[i].children = tokens[i].children.slice(0, -2);
}
}, {
/**
* 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}
Expand Down Expand Up @@ -757,4 +789,4 @@ exports.escapeHtml = function (str) {
};

},{}]},{},[1])(1)
});
});
2 changes: 1 addition & 1 deletion package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"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",
"main": "index.js",
"license": "MIT",
Expand Down

0 comments on commit fd42412

Please sign in to comment.