Skip to content

Commit c29b3da

Browse files
committed
Fix space before cites
1 parent 32db838 commit c29b3da

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

changelog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Next
44
- Changed TOC generation to only include wikitext headings.
55
- Fixed TOC being misplaced when non-wikitext headings are on the page.
6-
- Fixed spacing issues in output.
6+
- Fixed spacing issues in output such as in metadata and cite notes.
77

88
## 1.3.5
99
*2024-05-12*

src/parse.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -381,14 +381,8 @@ export function parse(data: string, config: Config = {}): Result {
381381
const ref = refs.find(ref => ref.name === refname);
382382
if (!ref) return _;
383383
ref.i++;
384-
const content = `
385-
<sup class="refnote">
386-
<a id="cite-${ref.id}${ref.i > 0 ? `_${ref.i}` : ''}" class="ref" href="#ref-${ref.id}">
387-
[${ref.id}]
388-
</a>
389-
</sup>
390-
`.trim();
391-
return content;
384+
const citeId = `cite-${ref.id}${ref.i > 0 ? `_${ref.i}` : ''}`
385+
return `<sup class="refnote"><a id="${citeId}" class="ref" href="#ref-${ref.id}">[${ref.id}]</a></sup>`;
392386
})
393387

394388
// Nonstandard: ``code`` and ```code blocks```

0 commit comments

Comments
 (0)