File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -173,17 +173,25 @@ export default {
173173 * NcReferenceList only accepts full URLs with origin.
174174 */
175175 sanitizedHref () {
176- const url = new URL (this .href , window .location )
177- return url .href
176+ try {
177+ const url = new URL (this .href , window .location )
178+ return url .href
179+ } catch {
180+ return this .href
181+ }
178182 },
179183
180184 title () {
181185 return this .referenceTitle ? this .referenceTitle : this .sanitizedHref
182186 },
183187
184188 showPreview () {
185- const url = new URL (this .href , window .location )
186- return this .href && PROTOCOLS_WITH_PREVIEW .includes (url .protocol )
189+ try {
190+ const url = new URL (this .href , window .location )
191+ return this .href && PROTOCOLS_WITH_PREVIEW .includes (url .protocol )
192+ } catch {
193+ return false
194+ }
187195 },
188196 },
189197
You can’t perform that action at this time.
0 commit comments