markdown-it-attrs
Advanced tools
Comparing version 0.7.0 to 0.7.1
10
index.js
@@ -97,4 +97,6 @@ 'use strict'; | ||
// attributes for blocks | ||
var lastInlineToken; | ||
if (hasCurly(tokens[i].content)) { | ||
var content = last(inlineTokens).content; | ||
lastInlineToken = last(inlineTokens); | ||
var content = lastInlineToken.content; | ||
var curlyStart = content.lastIndexOf('{'); | ||
@@ -130,3 +132,7 @@ var attrs = utils.getAttrs(content, curlyStart + 1, content.length - 1); | ||
utils.addAttrs(attrs, correspondingBlock); | ||
last(inlineTokens).content = removeCurly(content); | ||
lastInlineToken.content = removeCurly(content); | ||
if (lastInlineToken.content === '') { | ||
// remove empty inline token | ||
inlineTokens.pop(); | ||
} | ||
tokens[i].content = removeCurly(tokens[i].content); | ||
@@ -133,0 +139,0 @@ } |
@@ -98,4 +98,6 @@ (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){ | ||
// attributes for blocks | ||
var lastInlineToken; | ||
if (hasCurly(tokens[i].content)) { | ||
var content = last(inlineTokens).content; | ||
lastInlineToken = last(inlineTokens); | ||
var content = lastInlineToken.content; | ||
var curlyStart = content.lastIndexOf('{'); | ||
@@ -131,3 +133,7 @@ var attrs = utils.getAttrs(content, curlyStart + 1, content.length - 1); | ||
utils.addAttrs(attrs, correspondingBlock); | ||
last(inlineTokens).content = removeCurly(content); | ||
lastInlineToken.content = removeCurly(content); | ||
if (lastInlineToken.content === '') { | ||
// remove empty inline token | ||
inlineTokens.pop(); | ||
} | ||
tokens[i].content = removeCurly(tokens[i].content); | ||
@@ -134,0 +140,0 @@ } |
{ | ||
"name": "markdown-it-attrs", | ||
"version": "0.7.0", | ||
"version": "0.7.1", | ||
"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", |
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
25920
680