mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 09:46:22 +00:00
Merge branch 'master' into feature/add-smartquotes-toggle
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import markdownit from 'markdown-it'
|
||||
import sanitize from './markdown-it-sanitize-html'
|
||||
import emoji from 'markdown-it-emoji'
|
||||
import math from '@rokt33r/markdown-it-math'
|
||||
import _ from 'lodash'
|
||||
@@ -51,6 +52,18 @@ class Markdown {
|
||||
|
||||
const updatedOptions = Object.assign(defaultOptions, options)
|
||||
this.md = markdownit(updatedOptions)
|
||||
|
||||
// Sanitize use rinput before other plugins
|
||||
this.md.use(sanitize, {
|
||||
allowedTags: ['img', 'iframe'],
|
||||
allowedAttributes: {
|
||||
'*': ['alt', 'style'],
|
||||
'img': ['src', 'width', 'height'],
|
||||
'iframe': ['src', 'width', 'height', 'frameborder', 'allowfullscreen']
|
||||
},
|
||||
allowedIframeHostnames: ['www.youtube.com']
|
||||
})
|
||||
|
||||
this.md.use(emoji, {
|
||||
shortcuts: {}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user