Make paragraph respect whitespace
This commit is contained in:
parent
de333a769f
commit
137009762d
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue