File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -147,17 +147,25 @@ export default {
147147 * NcReferenceList only accepts full URLs with origin.
148148 */
149149 sanitizedHref () {
150- const url = new URL (this .href , window .location )
151- return url .href
150+ try {
151+ const url = new URL (this .href , window .location )
152+ return url .href
153+ } catch {
154+ return this .href
155+ }
152156 },
153157
154158 title () {
155159 return this .referenceTitle ? this .referenceTitle : this .sanitizedHref
156160 },
157161
158162 showPreview () {
159- const url = new URL (this .href , window .location )
160- return this .href && PROTOCOLS_WITH_PREVIEW .includes (url .protocol )
163+ try {
164+ const url = new URL (this .href , window .location )
165+ return this .href && PROTOCOLS_WITH_PREVIEW .includes (url .protocol )
166+ } catch {
167+ return false
168+ }
161169 },
162170 },
163171
You can’t perform that action at this time.
0 commit comments