Skip to content

Commit

Permalink
typeset internal links
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesdabbs committed Dec 11, 2023
1 parent 6016eb9 commit 772ad8e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
4 changes: 3 additions & 1 deletion packages/viewer/cypress/e2e/typesetting.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ it('renders internal links', () => {
)

cy.get('[data-testid=output]').contains(
'Discrete topology on a two-point set is $T_0$ as noted in Discrete topology on a two-point set is $T_0$',
// The T0T_0T0 rendering here is the text representation of the inner html of katex rendered math.
// We're effectively asserting that it _isn't_ still rendered as $T_0$
'Discrete topology on a two-point set is T0T_0T0​ as noted in Discrete topology on a two-point set is T0T_0T0​',
)
})
4 changes: 4 additions & 0 deletions packages/viewer/src/components/Shared/Typeset.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@
continue
}
$typeset(link.innerHTML, false).then(value => {
link.innerHTML = value
})
link.setAttribute('_wired', 'true')
link.addEventListener('click', e => {
e.preventDefault()
Expand Down
8 changes: 4 additions & 4 deletions packages/viewer/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ export default defineConfig({
test: {
include: ['src/**/*.{test,spec}.{js,ts}'],
coverage: {
lines: 80.3,
branches: 86.91,
statements: 80.3,
functions: 81,
lines: 83.09,
branches: 87.36,
statements: 83.09,
functions: 81.81,
skipFull: true,
thresholdAutoUpdate: true,
},
Expand Down

0 comments on commit 772ad8e

Please sign in to comment.