24 lines
584 B
Svelte
24 lines
584 B
Svelte
<!--
|
|
Copyright: Ankitects Pty Ltd and contributors
|
|
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
-->
|
|
<script lang="ts">
|
|
import { convertMathjax } from "./mathjax";
|
|
|
|
export let mathjax: string;
|
|
export let type: "inline" | "block" | "chemistry";
|
|
|
|
$: delimiters = type === "inline" ? ["\\[", "\\]"] : ["\\(", "\\)"];
|
|
$: converted = convertMathjax(`${delimiters[0]}${mathjax}${delimiters[1]}`);
|
|
</script>
|
|
|
|
<div on:click={console.log}>
|
|
{@html converted}
|
|
</div>
|
|
|
|
<style lang="scss">
|
|
div {
|
|
display: contents;
|
|
}
|
|
</style>
|