Skip to content

Commit

Permalink
fix : disable sanitize-html
Browse files Browse the repository at this point in the history
- 開発側のリソースにはサニタイズを無効化
  • Loading branch information
Liry24 committed Feb 28, 2025
1 parent f208d6e commit 3830da4
Showing 1 changed file with 1 addition and 84 deletions.
85 changes: 1 addition & 84 deletions components/ui/article.vue
Original file line number Diff line number Diff line change
@@ -1,95 +1,12 @@
<script setup lang="ts">
import sanitizeHtml from 'sanitize-html';
import { marked } from 'marked';
const props = defineProps<{
data: DocumentData;
type?: 'release' | 'info';
}>();
const main = sanitizeHtml(
await marked.parse(props.data.content, { breaks: true }),
{
allowedTags: [
'img',
'address',
'article',
'aside',
'footer',
'header',
'h1',
'h2',
'h3',
'h4',
'h5',
'h6',
'hgroup',
'main',
'nav',
'section',
'blockquote',
'dd',
'div',
'dl',
'dt',
'figcaption',
'figure',
'hr',
'li',
'main',
'ol',
'p',
'pre',
'ul',
'a',
'abbr',
'b',
'bdi',
'bdo',
'br',
'cite',
'code',
'data',
'dfn',
'em',
'i',
'kbd',
'mark',
'q',
'rb',
'rp',
'rt',
'rtc',
'ruby',
's',
'samp',
'small',
'span',
'strong',
'sub',
'sup',
'time',
'u',
'var',
'wbr',
'caption',
'col',
'colgroup',
'table',
'tbody',
'td',
'tfoot',
'th',
'thead',
'tr',
],
allowedAttributes: {
img: ['src', 'alt', 'title'],
a: ['href', 'name', 'target'],
},
allowedSchemes: ['https'],
}
);
const main = await marked.parse(props.data.content, { breaks: true });
const createdAt = new Date(props.data.created_at);
const updatedAt = new Date(props.data.updated_at);
Expand Down

0 comments on commit 3830da4

Please sign in to comment.