Skip to content

Commit

Permalink
fix(markdown): allow MsoNormal class attribute, and add default styli…
Browse files Browse the repository at this point in the history
…ng for it
  • Loading branch information
FredrikWallstrom authored and adrianschmidt committed Aug 27, 2024
1 parent 9740e25 commit de30904
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/markdown/markdown-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ export async function markdownToHTML(
.use(rehypeRaw)
.use(rehypeSanitize, {
...defaultSchema,
// Allow the `style` attribute on all elements
attributes: {
...defaultSchema.attributes,
'*': ['style', 'width'],
p: [['className', 'MsoNormal']], // Allow the class 'MsoNormal' on <p> elements
'*': ['style', 'width'], // Allow `style` and 'width' attribute on all elements
},
})
.use(() => {
Expand Down
4 changes: 4 additions & 0 deletions src/components/markdown/markdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@ hr {
img {
max-width: 100%;
}

.MsoNormal {
margin: 0;
}

0 comments on commit de30904

Please sign in to comment.