mirror of
https://github.com/hcengineering/platform.git
synced 2024-11-24 06:43:16 +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()
|
||||
|
||||
$: dom = parser.parseFromString(message, 'application/xhtml+xml').firstChild as HTMLElement
|
||||
$: dom = parser.parseFromString(message, 'text/html').firstChild?.childNodes[1] as HTMLElement
|
||||
</script>
|
||||
|
||||
<Nodes nodes={dom.childNodes}/>
|
||||
|
@ -25,11 +25,19 @@
|
||||
{#if node.nodeType === Node.TEXT_NODE}
|
||||
{node.data}
|
||||
{:else}
|
||||
{#if node.nodeName === 'em'}
|
||||
{#if node.nodeName === '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>
|
||||
{: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')} />
|
||||
{:else}
|
||||
Unknown { node.nodeName }
|
||||
|
Loading…
Reference in New Issue
Block a user