refac
This commit is contained in:
1 parent
18adb28da0
commit
5e4e1cf662
4 files changed
+48
-12
No files matched your search
@@ -15,6 +15,7 @@
|
||||
import Source from './Source.svelte';
|
||||
import HtmlToken from './HTMLToken.svelte';
|
||||
import TextToken from './MarkdownInlineTokens/TextToken.svelte';
|
||||
import CodespanToken from './MarkdownInlineTokens/CodespanToken.svelte';
|
||||
|
||||
export let id: string;
|
||||
export let done = true;
|
||||
@@ -30,7 +31,7 @@
|
||||
{:else if token.type === 'link'}
|
||||
{#if token.tokens}
|
||||
<a href={token.href} target="_blank" rel="nofollow" title={token.title}>
|
||||
<svelte:self id={`${id}-a`} tokens={token.tokens} {onSourceClick} />
|
||||
<svelte:self id={`${id}-a`} tokens={token.tokens} {onSourceClick} {done} />
|
||||
</a>
|
||||
{:else}
|
||||
<a href={token.href} target="_blank" rel="nofollow" title={token.title}>{token.text}</a>
|
||||
@@ -42,15 +43,7 @@
|
||||
{:else if token.type === 'em'}
|
||||
<em><svelte:self id={`${id}-em`} tokens={token.tokens} {onSourceClick} /></em>
|
||||
{:else if token.type === 'codespan'}
|
||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||
<!-- svelte-ignore a11y-no-noninteractive-element-interactions -->
|
||||
<code
|
||||
class="codespan cursor-pointer"
|
||||
on:click={() => {
|
||||
copyToClipboard(unescapeHtml(token.text));
|
||||
toast.success($i18n.t('Copied to clipboard'));
|
||||
}}>{unescapeHtml(token.text)}</code
|
||||
>
|
||||
<CodespanToken {token} {done} />
|
||||
{:else if token.type === 'br'}
|
||||
<br />
|
||||
{:else if token.type === 'del'}
|
||||
|
||||
Reference in new issue
Block a user