Skip to content

Commit

Permalink
feat: markdown 内写html标签时,允许使用 style 属性(之前不行),允许 center 标签
Browse files Browse the repository at this point in the history
  • Loading branch information
Mereithhh committed Mar 22, 2023
1 parent f583898 commit 688172b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/admin/src/components/Editor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ import { LinkTarget } from './plugins/linkTarget';

const sanitize = (schema) => {
schema.protocols.src.push('data')
schema.tagNames.push("center")
schema.attributes["*"].push("style")
return schema
}

Expand Down
2 changes: 2 additions & 0 deletions packages/website/components/Markdown/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ const plugins = [
]
const sanitize = (schema) => {
schema.protocols.src.push('data')
schema.tagNames.push("center")
schema.attributes["*"].push("style")
return schema
}
export default function ({ content }: { content: string }) {
Expand Down

0 comments on commit 688172b

Please sign in to comment.