1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 01:36:22 +00:00

- add data-line attribute to definition lists and lists

- add tests
This commit is contained in:
Baptiste Augrain
2018-09-17 22:46:20 +02:00
parent 15b9f8e13f
commit 76928e43a3
6 changed files with 156 additions and 20 deletions

View File

@@ -116,7 +116,7 @@ module.exports = function definitionListPlugin (md) {
for (;;) {
token = state.push('dd_open', 'dd', 1)
token.map = itemLines = [ nextLine, 0 ]
token.map = itemLines = [ ddLine, 0 ]
pos = contentStart
max = state.eMarks[ddLine]

View File

@@ -251,9 +251,12 @@ class Markdown {
this.md.renderer.render = (tokens, options, env) => {
tokens.forEach((token) => {
switch (token.type) {
case 'heading_open':
case 'paragraph_open':
case 'blockquote_open':
case 'dd_open':
case 'dt_open':
case 'heading_open':
case 'list_item_open':
case 'paragraph_open':
case 'table_open':
token.attrPush(['data-line', token.map[0]])
}