Skip to content

Commit

Permalink
🛑 Stop turning dois to links in typst (#880)
Browse files Browse the repository at this point in the history
  • Loading branch information
fwkoch authored Jan 30, 2024
1 parent 4b5ca6a commit f7fd905
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .changeset/yellow-seas-drop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'myst-to-typst': patch
---

Stop turning dois to links in typst
14 changes: 5 additions & 9 deletions packages/myst-to-typst/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,15 +286,11 @@ const handlers: Record<string, Handler> = {
state.renderChildren(node, 0, ' ');
},
cite(node, state) {
if (node.protocol === 'doi' || node.label?.startsWith('https://doi.org')) {
linkHandler(node, state);
} else {
state.write(`#cite(<${node.label}>`);
if (node.kind === 'narrative') state.write(`, form: "prose"`);
// node.prefix not supported by typst: see https://github.com/typst/typst/issues/1139
if (node.suffix) state.write(`, supplement: [${node.suffix}]`);
state.write(`)`);
}
state.write(`#cite(<${node.label}>`);
if (node.kind === 'narrative') state.write(`, form: "prose"`);
// node.prefix not supported by typst: see https://github.com/typst/typst/issues/1139
if (node.suffix) state.write(`, supplement: [${node.suffix}]`);
state.write(`)`);
},
embed(node, state) {
state.renderChildren(node);
Expand Down

0 comments on commit f7fd905

Please sign in to comment.