Comparing version 0.0.24 to 0.0.25
@@ -68,4 +68,6 @@ 'use strict'; | ||
} | ||
var wrappedNode = node.children[0]; | ||
wrappedNode.caption = node.caption; | ||
node.children = node.children.filter(function (node) { | ||
@@ -77,5 +79,7 @@ return node.type !== 'figcaption'; | ||
} | ||
var extra = has(makeExtra, type) ? makeExtra[type](wrappedNode) : undefined; | ||
var innerText = all(ctx, node) || node.value || ''; | ||
return macro(innerText.trim(), caption, extra); | ||
} |
'use strict'; | ||
/** | ||
* Created by fdambrine on 06/07/17. | ||
*/ | ||
module.exports = function (node, index, parent) { | ||
@@ -12,2 +9,3 @@ var linkNode = { | ||
}; | ||
var thumbnailNode = { | ||
@@ -17,2 +15,3 @@ type: 'image', | ||
}; | ||
if (parent.type !== 'figure') { | ||
@@ -26,7 +25,7 @@ var figureNode = { | ||
}; | ||
parent.children.splice(index, 1, figureNode); | ||
parent.children[index] = figureNode; | ||
} else { | ||
parent.children.splice(index, 1, thumbnailNode); | ||
parent.children[index] = thumbnailNode; | ||
parent.children[parent.children.length - 1].children.push(linkNode); | ||
} | ||
}; |
@@ -5,6 +5,7 @@ 'use strict'; | ||
var visit = require('unist-util-visit'); | ||
var referencePlugin = require('./referenceVisitor'); | ||
var codePlugin = require('./codeVisitor'); | ||
var headingPlugin = require('./headingVisitor'); | ||
var iframePlugin = require('./iframes'); | ||
var headingPlugin = require('./headingVisitor'); | ||
var referencePlugin = require('./referenceVisitor'); | ||
@@ -11,0 +12,0 @@ module.exports = preVisit; |
{ | ||
"name": "rebber", | ||
"version": "0.0.24", | ||
"version": "0.0.25", | ||
"description": "Stringifies MDAST to LaTeX", | ||
@@ -47,3 +47,3 @@ "repository": "https://github.com/zestedesavoir/zmarkdown/tree/master/packages/rebber", | ||
"remark-align": "^0.0.23", | ||
"remark-captions": "^0.0.17", | ||
"remark-captions": "^0.0.18", | ||
"remark-emoticons": "^0.0.19", | ||
@@ -50,0 +50,0 @@ "remark-grid-tables": "^0.0.12", |
@@ -41,5 +41,3 @@ /* Dependencies. */ | ||
}, | ||
image: node => { | ||
return {url: node.url, width: '\\linewidth'} | ||
} | ||
image: node => ({url: node.url, width: '\\linewidth'}) | ||
} | ||
@@ -66,4 +64,6 @@ | ||
} | ||
const wrappedNode = node.children[0] | ||
wrappedNode.caption = node.caption | ||
node.children = node.children.filter(node => node.type !== 'figcaption') | ||
@@ -73,5 +73,7 @@ if (node.children.length === 1) { | ||
} | ||
const extra = has(makeExtra, type) ? makeExtra[type](wrappedNode) : undefined | ||
const innerText = all(ctx, node) || node.value || '' | ||
return macro(innerText.trim(), caption, extra) | ||
} |
@@ -1,4 +0,1 @@ | ||
/** | ||
* Created by fdambrine on 06/07/17. | ||
*/ | ||
module.exports = (node, index, parent) => { | ||
@@ -12,2 +9,3 @@ const linkNode = { | ||
} | ||
const thumbnailNode = { | ||
@@ -17,2 +15,3 @@ type: 'image', | ||
} | ||
if (parent.type !== 'figure') { | ||
@@ -26,7 +25,7 @@ const figureNode = { | ||
} | ||
parent.children.splice(index, 1, figureNode) | ||
parent.children[index] = figureNode | ||
} else { | ||
parent.children.splice(index, 1, thumbnailNode) | ||
parent.children[index] = thumbnailNode | ||
parent.children[parent.children.length - 1].children.push(linkNode) | ||
} | ||
} |
const xtend = require('xtend') | ||
const visit = require('unist-util-visit') | ||
const referencePlugin = require('./referenceVisitor') | ||
const codePlugin = require('./codeVisitor') | ||
const headingPlugin = require('./headingVisitor') | ||
const iframePlugin = require('./iframes') | ||
const headingPlugin = require('./headingVisitor') | ||
const referencePlugin = require('./referenceVisitor') | ||
@@ -8,0 +9,0 @@ module.exports = preVisit |
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
53721
1565