Make paragraph respect whitespace

This commit is contained in:
Andrew Kingston 2021-02-23 10:04:07 +00:00
parent de333a769f
commit 137009762d
1 changed files with 3 additions and 28 deletions

View File

@ -5,38 +5,13 @@
const component = getContext("component")
export let text = ""
export let className = ""
export let type = ""
const isTag = tag => type === tag
</script>
{#if isTag('none')}
<span use:styleable={$component.styles}>{text}</span>
{:else if isTag('bold')}
<b class={className} use:styleable={$component.styles}>{text}</b>
{:else if isTag('strong')}
<strong class={className} use:styleable={$component.styles}>{text}</strong>
{:else if isTag('italic')}
<i class={className} use:styleable={$component.styles}>{text}</i>
{:else if isTag('emphasis')}
<em class={className} use:styleable={$component.styles}>{text}</em>
{:else if isTag('mark')}
<mark class={className} use:styleable={$component.styles}>{text}</mark>
{:else if isTag('small')}
<small class={className} use:styleable={$component.styles}>{text}</small>
{:else if isTag('del')}
<del class={className} use:styleable={$component.styles}>{text}</del>
{:else if isTag('ins')}
<ins class={className} use:styleable={$component.styles}>{text}</ins>
{:else if isTag('sub')}
<sub class={className} use:styleable={$component.styles}>{text}</sub>
{:else if isTag('sup')}
<sup class={className} use:styleable={$component.styles}>{text}</sup>
{:else}<span use:styleable={$component.styles}>{text}</span>{/if}
<p use:styleable={$component.styles}>{text}</p>
<style>
span {
p {
display: inline-block;
white-space: pre-wrap;
}
</style>