Comparing version 0.0.11 to 0.0.12
@@ -14,4 +14,25 @@ 'use strict'; | ||
return '\\begin{Quotation}{' + caption + '}\n' + innerText + '\n\\end{Quotation}\n\n'; | ||
}, | ||
code: function code(_code, caption, extra) { | ||
var params = '[' + caption + ']'; | ||
if (extra.lines) { | ||
params += '[' + extra.lines + ']'; | ||
} | ||
return '\\begin{codeBlock}' + params + '{' + extra.language + '}' + ('\n' + _code + '\n\\end{codeBlock}\n\n'); | ||
} | ||
}; | ||
var makeExtra = { | ||
blockquote: function blockquote(node) {}, | ||
code: function code(node) { | ||
var extra = { language: node.lang.split(' ')[0] }; | ||
if (node.lang.includes(' ')) { | ||
var tail = node.lang.split(' ')[1]; | ||
if (tail) { | ||
extra.lines = tail.replace('hl_lines=', '').trim(); | ||
} | ||
} | ||
return extra; | ||
} | ||
/* Stringify a Figure `node`. */ | ||
@@ -38,4 +59,5 @@ };function figure(ctx, node) { | ||
} | ||
var innerText = all(ctx, node); | ||
return macro(innerText.trim(), caption); | ||
var innerText = all(ctx, node) || node.value; | ||
return macro(innerText.trim(), caption, makeExtra[type](node)); | ||
} |
@@ -20,2 +20,3 @@ 'use strict'; | ||
handlers.break = require('./types/break'); | ||
handlers.code = require('./types/code'); | ||
handlers.strong = require('./types/strong'); | ||
@@ -26,2 +27,5 @@ handlers.emphasis = require('./types/emphasis'); | ||
handlers.blockquote = require('./types/blockquote'); | ||
handlers.tableCell = require('./types/tableCell'); | ||
handlers.tableRow = require('./types/tableRow'); | ||
handlers.table = require('./types/table'); | ||
handlers.thematicBreak = require('./types/thematic-break' | ||
@@ -28,0 +32,0 @@ |
{ | ||
"name": "rebber", | ||
"version": "0.0.11", | ||
"version": "0.0.12", | ||
"description": "Stringifies MDAST to LaTeX", | ||
@@ -20,4 +20,4 @@ "repository": "https://github.com/zestedesavoir/zmarkdown/tree/master/packages/rebber", | ||
"pretest": "eslint src", | ||
"prepublish": "del-cli dist && BABEL_ENV=production babel --out-dir dist src", | ||
"test": "npm run prepublish && nyc ava __tests__", | ||
"prepare": "del-cli dist && cross-env BABEL_ENV=production babel --out-dir dist src", | ||
"test": "npm run prepare && nyc ava __tests__", | ||
"coverage": "./node_modules/.bin/nyc report --reporter=text-lcov > coverage/coverage.lcov" | ||
@@ -44,14 +44,14 @@ }, | ||
"ava": "^0.19.1", | ||
"babel-cli": "^6.24.1", | ||
"babel-preset-es2015": "^6.24.1", | ||
"coveralls": "^2.13.1", | ||
"cross-env": "^5.0.1", | ||
"del-cli": "^1.0.0", | ||
"eslint": "^4.0.0", | ||
"nyc": "^11.0.2", | ||
"remark": "^7.0.1", | ||
"remark-captions": "^0.0.4", | ||
"remark-emoticons": "^0.0.14", | ||
"remark-captions": "^0.0.6", | ||
"remark-emoticons": "^0.0.15", | ||
"remark-parse": "^3.0.1", | ||
"remark-sub-super": "^0.0.12", | ||
"unified": "^6.1.4" | ||
"remark-sub-super": "^0.0.13", | ||
"unified": "^6.1.5" | ||
} | ||
} |
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
14419
26
388