Make paragraph respect whitespace
This commit is contained in:
parent
de333a769f
commit
137009762d
|
@ -5,38 +5,13 @@
|
||||||
const component = getContext("component")
|
const component = getContext("component")
|
||||||
|
|
||||||
export let text = ""
|
export let text = ""
|
||||||
export let className = ""
|
|
||||||
export let type = ""
|
|
||||||
|
|
||||||
const isTag = tag => type === tag
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if isTag('none')}
|
<p use:styleable={$component.styles}>{text}</p>
|
||||||
<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}
|
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
span {
|
p {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
white-space: pre-wrap;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
Loading…
Reference in New Issue