@marp-team/marpit
Advanced tools
Comparing version 0.0.14 to 0.0.15
@@ -5,2 +5,8 @@ # Change Log | ||
## v0.0.15 - 2018-09-06 | ||
### Fixed | ||
- Improve rendering header and footer to use inline tokens ([#66](https://github.com/marp-team/marpit/pull/66)) | ||
## v0.0.14 - 2018-09-02 | ||
@@ -7,0 +13,0 @@ |
@@ -142,11 +142,11 @@ "use strict"; | ||
footer(value) { | ||
return { | ||
return typeof value === 'string' ? { | ||
footer: value | ||
}; | ||
} : {}; | ||
}, | ||
header(value) { | ||
return { | ||
return typeof value === 'string' ? { | ||
header: value | ||
}; | ||
} : {}; | ||
}, | ||
@@ -153,0 +153,0 @@ |
@@ -8,4 +8,2 @@ "use strict"; | ||
var _token = _interopRequireDefault(require("markdown-it/lib/token")); | ||
var _wrap_tokens = _interopRequireDefault(require("../helpers/wrap_tokens")); | ||
@@ -28,25 +26,22 @@ | ||
if (state.inlineMode) return; | ||
const renderedInlines = new Map(); | ||
const parsedInlines = new Map(); | ||
const getRendered = markdown => { | ||
let rendered = renderedInlines.get(markdown); | ||
const getParsed = markdown => { | ||
let parsed = parsedInlines.get(markdown); | ||
if (!rendered) { | ||
rendered = md.renderInline(markdown, state.env); | ||
renderedInlines.set(markdown, rendered); | ||
if (!parsed) { | ||
parsed = md.parseInline(markdown, state.env); | ||
delete parsed.map; | ||
parsedInlines.set(markdown, parsed); | ||
} | ||
return rendered; | ||
return parsed; | ||
}; | ||
const createMarginalTokens = (tag, markdown) => { | ||
const token = new _token.default('html_block', '', 0); | ||
token.content = getRendered(markdown); | ||
return (0, _wrap_tokens.default)(`marpit_${tag}`, { | ||
tag, | ||
close: { | ||
block: true | ||
} | ||
}, [token]); | ||
}; | ||
const createMarginalTokens = (tag, markdown) => (0, _wrap_tokens.default)(`marpit_${tag}`, { | ||
tag, | ||
close: { | ||
block: true | ||
} | ||
}, getParsed(markdown)); | ||
@@ -53,0 +48,0 @@ let current; |
{ | ||
"name": "@marp-team/marpit", | ||
"version": "0.0.14", | ||
"version": "0.0.15", | ||
"description": "The skinny framework for creating slide deck from Markdown", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -1,18 +0,14 @@ | ||
<div align="center"> | ||
<p> | ||
<a href="https://marpit.marp.app"><img src="https://github.com/marp-team/marpit/blob/master/docs/marpit.png?raw=true" alt="Marpit" width="500" /></a> | ||
</p> | ||
<p> | ||
<strong>Marpit</strong>: Markdown slide deck framework | ||
</p> | ||
<p> | ||
<p align="center"> | ||
<a href="https://marpit.marp.app"><img src="https://github.com/marp-team/marpit/blob/master/docs/marpit.png?raw=true" alt="Marpit" width="500" /></a> | ||
</p> | ||
<p align="center"> | ||
<strong>Marpit</strong>: Markdown slide deck framework | ||
</p> | ||
<p align="center"> | ||
<a href="https://circleci.com/gh/marp-team/marpit/"><img src="https://img.shields.io/circleci/project/github/marp-team/marpit/master.svg?style=flat-square" alt="CircleCI" /></a> | ||
<a href="https://codecov.io/gh/marp-team/marpit"><img src="https://img.shields.io/codecov/c/github/marp-team/marpit/master.svg?style=flat-square" alt="Codecov" /></a> | ||
<a href="https://www.npmjs.com/package/@marp-team/marpit"><img src="https://img.shields.io/npm/v/@marp-team/marpit.svg?style=flat-square" alt="npm" /></a> | ||
<a href="./LICENSE"><img src="https://img.shields.io/github/license/marp-team/marpit.svg?style=flat-square" alt="LICENSE" /></a> | ||
</p> | ||
[](https://circleci.com/gh/marp-team/marpit/) | ||
[](https://codecov.io/gh/marp-team/marpit) | ||
[](https://www.npmjs.com/package/@marp-team/marpit) | ||
[](./LICENSE) | ||
</p> | ||
</div> | ||
--- | ||
@@ -19,0 +15,0 @@ |
128121
2459
633