markdown-it-implicit-figures
Advanced tools
Comparing version 0.4.0 to 0.5.0
10
index.js
@@ -7,2 +7,5 @@ 'use strict'; | ||
function implicitFigures(state) { | ||
// reset tabIndex on md.render() | ||
var tabIndex = 1; | ||
// do not process first and last token | ||
@@ -58,2 +61,9 @@ for (var i=1, l=state.tokens.length; i < (l - 1); ++i) { | ||
} | ||
if (options.tabindex == true) { | ||
// add a tabindex property | ||
// you could use this with css-tricks.com/expanding-images-html5 | ||
state.tokens[i - 1].attrPush(['tabindex', tabIndex]); | ||
tabIndex++; | ||
} | ||
} | ||
@@ -60,0 +70,0 @@ } |
{ | ||
"name": "markdown-it-implicit-figures", | ||
"version": "0.4.0", | ||
"version": "0.5.0", | ||
"description": "Render images occurring by itself in a paragraph as `<figure><img ...></figure>`, similar to pandoc's implicit_figures", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -65,2 +65,6 @@ # markdown-it-implicit-figures [![Build Status](https://travis-ci.org/arve0/markdown-it-implicit-figures.svg?branch=master)](https://travis-ci.org/arve0/markdown-it-implicit-figures) [![npm version](https://badge.fury.io/js/markdown-it-implicit-figures.svg)](http://badge.fury.io/js/markdown-it-implicit-figures) | ||
``` | ||
- `tabindex`: Set `tabindex` to `true` to add a `tabindex` property to each | ||
figure, beginning at `tabindex="1"` and incrementing for each figure | ||
encountered. Could be used with [this css-trick](https://css-tricks.com/expanding-images-html5/), | ||
which expands figures upon mouse-over. | ||
@@ -67,0 +71,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
7141
68
75