mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-18 11:36:36 +00:00
docs: escape HTML in component prop descriptions
This commit is contained in:
parent
75d12648ed
commit
04d35f51f1
1 changed files with 4 additions and 1 deletions
|
@ -138,7 +138,10 @@
|
|||
{#if prop.description}
|
||||
{#each prop.description.split('\n') as line}
|
||||
<div class="description">
|
||||
{@html line.replace(/`(.*?)`/g, '<code>$1</code>')}.
|
||||
{@html line
|
||||
.replace(/\</g, '<')
|
||||
.replace(/\>/g, '>')
|
||||
.replace(/`(.*?)`/g, '<code>$1</code>')}.
|
||||
</div>
|
||||
{/each}
|
||||
{:else}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue