Skip to content

Commit

Permalink
Merge branch 'master' into generate-inline-svg
Browse files Browse the repository at this point in the history
raghur authored Dec 23, 2023
2 parents 053b111 + 4d63fe5 commit 9a93fc3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
@@ -113,7 +113,6 @@ function mermaid (type, value, _format, _meta) {
if (options.loc === 'inline') {
if (options.format === 'svg') {
const svg = fs.readFileSync(savePath, 'utf8')
// newPath = 'data:image/svg+xml;base64,' + Buffer.from(data).toString('base64')
// does not use default theme - picks the forest theme in the test.md
return pandoc.Div(
[id, imageClasses, []],
@@ -140,6 +139,7 @@ function mermaid (type, value, _format, _meta) {
fig = 'fig:'
}


return pandoc.Para([
pandoc.Image(
[id, imageClasses, []],
@@ -151,6 +151,7 @@ function mermaid (type, value, _format, _meta) {
function mv (from, to) {
const readStream = fs.createReadStream(from)
const writeStream = fs.createWriteStream(to)

const parent = path.dirname(to)
if (!fs.existsSync(parent)) {
fs.mkdirSync(parent, { recursive: true })

0 comments on commit 9a93fc3

Please sign in to comment.