mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 14:29:34 +00:00
Merge branch 'main' of https://bitbucket.org/studiotem/jandl-taskmanager-app into production
This commit is contained in:
commit
9e9326ebdd
2 files changed
+26
No files matched your search
@@ -2,6 +2,7 @@ import { createApp } from 'vue'
|
|||||||
import { IonicVue } from '@ionic/vue'
|
import { IonicVue } from '@ionic/vue'
|
||||||
import { loadFonts } from './webfontloader'
|
import { loadFonts } from './webfontloader'
|
||||||
import vuetify from './vuetify'
|
import vuetify from './vuetify'
|
||||||
|
import { registerQuillUrlSanitizer } from './quill.util'
|
||||||
import loader from 'vue-loading-overlay'
|
import loader from 'vue-loading-overlay'
|
||||||
import App from './App.vue'
|
import App from './App.vue'
|
||||||
|
|
||||||
@@ -29,6 +30,7 @@ import 'vue-loading-overlay/dist/vue-loading.css'
|
|||||||
import '@vuepic/vue-datepicker/dist/main.css'
|
import '@vuepic/vue-datepicker/dist/main.css'
|
||||||
|
|
||||||
loadFonts()
|
loadFonts()
|
||||||
|
registerQuillUrlSanitizer()
|
||||||
|
|
||||||
const options: Options = {
|
const options: Options = {
|
||||||
axios: {
|
axios: {
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
import { Quill } from '@vueup/vue-quill'
|
||||||
|
|
||||||
|
export function registerQuillUrlSanitizer() {
|
||||||
|
const Link = Quill.import('formats/link')
|
||||||
|
|
||||||
|
class CustomLinkSanitizer extends Link {
|
||||||
|
static sanitize(url) {
|
||||||
|
const sanitizedUrl = super.sanitize(url)
|
||||||
|
|
||||||
|
if (!sanitizedUrl || sanitizedUrl === 'about:blank') return sanitizedUrl
|
||||||
|
|
||||||
|
const protocolWhhitelist = ['http', 'https', 'mailto', 'tel', 'radar', 'rdar', 'smb', 'sms']
|
||||||
|
const hasWhitelistedProtocol = protocolWhhitelist.some(function(protocol) {
|
||||||
|
return sanitizedUrl.startsWith(protocol)
|
||||||
|
})
|
||||||
|
|
||||||
|
if (hasWhitelistedProtocol) return sanitizedUrl
|
||||||
|
|
||||||
|
return `https://${sanitizedUrl}`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Quill.register(CustomLinkSanitizer, true)
|
||||||
|
}
|
||||||
Reference in new issue
Block a user