From bbdbfcc3ecac08b9a5ae972836eb29ada7337956 Mon Sep 17 00:00:00 2001 From: Franklin Koch Date: Tue, 30 Jan 2024 12:48:22 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=9B=91=20Stop=20turning=20dois=20to=20lin?= =?UTF-8?q?ks=20in=20typst?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changeset/yellow-seas-drop.md | 5 +++++ packages/myst-to-typst/src/index.ts | 14 +++++--------- 2 files changed, 10 insertions(+), 9 deletions(-) create mode 100644 .changeset/yellow-seas-drop.md diff --git a/.changeset/yellow-seas-drop.md b/.changeset/yellow-seas-drop.md new file mode 100644 index 000000000..73e1cf7c0 --- /dev/null +++ b/.changeset/yellow-seas-drop.md @@ -0,0 +1,5 @@ +--- +'myst-to-typst': patch +--- + +Stop turning dois to links in typst diff --git a/packages/myst-to-typst/src/index.ts b/packages/myst-to-typst/src/index.ts index 9460220db..b40235b77 100644 --- a/packages/myst-to-typst/src/index.ts +++ b/packages/myst-to-typst/src/index.ts @@ -286,15 +286,11 @@ const handlers: Record = { 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);