Skip to content

Commit 0af0243

Browse files
authored
Merge pull request #774 from dgwyer/getting-started-md-link
Fix CommonMark link bug for index page
2 parents 6ffefe2 + 97cfbd0 commit 0af0243

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

nbs/_quarto.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ format:
1414
- cosmo
1515
- custom.scss
1616
css: styles.css
17+
include-after-body: fix-commonmark.html
1718
toc: true
1819
keep-md: true
1920
canonical-url: true

nbs/fix-commonmark.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<script type="application/javascript">
2+
// Fix CommonMark link bug where Quarto JS changes index.html.md to .md
3+
document.addEventListener('DOMContentLoaded', function() {
4+
function fixCommonMarkLinks() {
5+
document.querySelectorAll('a[data-original-href*="index.html.md"]').forEach(link => {
6+
if (link.dataset.originalHref) { link.href = link.dataset.originalHref; }
7+
});
8+
}
9+
fixCommonMarkLinks();
10+
});
11+
</script>

0 commit comments

Comments
 (0)