mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-18 08:22:17 +03:00
Merge pull request #361 from hcengineering/main
Merge #343 into develop
This commit is contained in:
commit
5ea2d326b9
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
const parser = new DOMParser()
|
const parser = new DOMParser()
|
||||||
|
|
||||||
$: dom = parser.parseFromString(message, 'application/xhtml+xml').firstChild as HTMLElement
|
$: dom = parser.parseFromString(message, 'text/html').firstChild?.childNodes[1] as HTMLElement
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Nodes nodes={dom.childNodes}/>
|
<Nodes nodes={dom.childNodes}/>
|
||||||
|
@ -25,11 +25,19 @@
|
|||||||
{#if node.nodeType === Node.TEXT_NODE}
|
{#if node.nodeType === Node.TEXT_NODE}
|
||||||
{node.data}
|
{node.data}
|
||||||
{:else}
|
{:else}
|
||||||
{#if node.nodeName === 'em'}
|
{#if node.nodeName === 'EM'}
|
||||||
<em><svelte:self nodes={node.childNodes}/></em>
|
<em><svelte:self nodes={node.childNodes}/></em>
|
||||||
{:else if node.nodeName === 'strong'}
|
{:else if node.nodeName === 'STRONG'}
|
||||||
<strong><svelte:self nodes={node.childNodes}/></strong>
|
<strong><svelte:self nodes={node.childNodes}/></strong>
|
||||||
{:else if node.nodeName === 'span'}
|
{:else if node.nodeName === 'P'}
|
||||||
|
<p><svelte:self nodes={node.childNodes}/></p>
|
||||||
|
{:else if node.nodeName === 'BLOCKQUOTE'}
|
||||||
|
<blockquote><svelte:self nodes={node.childNodes}/></blockquote>
|
||||||
|
{:else if node.nodeName === 'CODE'}
|
||||||
|
<code><svelte:self nodes={node.childNodes}/></code>
|
||||||
|
{:else if node.nodeName === 'BR'}
|
||||||
|
<br/>
|
||||||
|
{:else if node.nodeName === 'SPAN'}
|
||||||
<Person objectId={node.getAttribute('data-id')} title={node.getAttribute('data-label')} />
|
<Person objectId={node.getAttribute('data-id')} title={node.getAttribute('data-label')} />
|
||||||
{:else}
|
{:else}
|
||||||
Unknown { node.nodeName }
|
Unknown { node.nodeName }
|
||||||
|
Loading…
Reference in New Issue
Block a user