remove sanitize-html
This commit is contained in:
parent
5d958de5a8
commit
b053aded18
1719
package-lock.json
generated
1719
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
|
@ -35,8 +35,6 @@
|
|||
"i18next-icu": "2.3.0",
|
||||
"intl-messageformat": "10.5.3",
|
||||
"just-throttle": "4.2.0",
|
||||
"mailgun.js": "8.2.1",
|
||||
"sanitize-html": "2.11.0",
|
||||
"mailgun.js": "8.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import { createMemo, createSignal, For, Show } from 'solid-js'
|
||||
import sanitizeHtml from 'sanitize-html'
|
||||
|
||||
import type { Shout } from '../../../graphql/types.gen'
|
||||
|
||||
|
@ -90,14 +89,6 @@ const getTitleAndSubtitle = (
|
|||
return { title, subtitle }
|
||||
}
|
||||
|
||||
const sanitizeString = (html) =>
|
||||
sanitizeHtml(html, {
|
||||
allowedTags: ['span'],
|
||||
allowedAttributes: {
|
||||
span: ['class'],
|
||||
},
|
||||
})
|
||||
|
||||
export const ArticleCard = (props: ArticleCardProps) => {
|
||||
const { t, lang, formatDate } = useLocalize()
|
||||
const { user } = useSession()
|
||||
|
@ -223,13 +214,13 @@ export const ArticleCard = (props: ArticleCardProps) => {
|
|||
<a href={getPagePath(router, 'article', { slug: props.article.slug })}>
|
||||
<div class={styles.shoutCardTitle}>
|
||||
<span class={styles.shoutCardLinkWrapper}>
|
||||
<span class={styles.shoutCardLinkContainer} innerHTML={sanitizeString(title)} />
|
||||
<span class={styles.shoutCardLinkContainer} innerHTML={title} />
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<Show when={!props.settings?.nosubtitle && subtitle}>
|
||||
<div class={styles.shoutCardSubtitle}>
|
||||
<span class={styles.shoutCardLinkContainer} innerHTML={sanitizeString(subtitle)} />
|
||||
<span class={styles.shoutCardLinkContainer} innerHTML={subtitle} />
|
||||
</div>
|
||||
</Show>
|
||||
</a>
|
||||
|
@ -259,10 +250,7 @@ export const ArticleCard = (props: ArticleCardProps) => {
|
|||
</div>
|
||||
</Show>
|
||||
<Show when={props.article.description}>
|
||||
<section
|
||||
class={styles.shoutCardDescription}
|
||||
innerHTML={sanitizeString(props.article.description)}
|
||||
/>
|
||||
<section class={styles.shoutCardDescription} innerHTML={props.article.description} />
|
||||
</Show>
|
||||
<Show when={props.settings?.isFeedMode}>
|
||||
<Show when={props.article.description}>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { createSignal, Show, For, JSX } from 'solid-js'
|
||||
import { createSignal, Show, For } from 'solid-js'
|
||||
|
||||
import { Button } from '../../_shared/Button'
|
||||
import { Icon } from '../../_shared/Icon'
|
||||
|
|
Loading…
Reference in New Issue
Block a user