Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump pandoc filter version to v2.2.0 #122

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ const fs = require('fs')
const tmpObj = tmp.fileSync({ mode: 0o644, prefix: 'mermaid-filter-', postfix: '.err' })
const errorLog = fs.createWriteStream(tmpObj.name)

pandoc.toJSONFilter(function (type, value, format, meta) {
pandoc.toJSONFilter(function (ele,format,meta) {
// Redirect stderr to a globally created writeable stream
process.stderr.write = errorLog.write.bind(errorLog)
return utils.mermaid(type, value, format, meta)
return utils.mermaid(ele.t, ele.c, format, meta)
})
34 changes: 17 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@mermaid-js/mermaid-cli": "^10",
"imgur": "^0.3.1",
"minimist": ">=0.2.1",
"pandoc-filter": "^0.1.3",
"pandoc-filter": "^2.2.0",
"sanitize-filename": "1.6.1",
"tmp": "^0.0.28"
},
Expand Down
4 changes: 1 addition & 3 deletions test.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@ sequenceDiagram
John-->>Alice: Great!
```
## fig ref
```{.mermaid #fig:ref caption="Caption" format=png loc=img/child alt="should have id of fig:ref"}

If an id starts with `fig:`, then `title` attribute is set to `fig:`

```{.mermaid #fig:ref caption="Caption" format=png loc=img/child alt="should have id of fig:ref"}
sequenceDiagram
Note right of John: png with id as attr
Alice->>John: Hello John, how are you?
Expand Down