diff --git a/playground/next/editor.mjs b/playground/next/editor.mjs index 48466a4d..1082c88e 100644 --- a/playground/next/editor.mjs +++ b/playground/next/editor.mjs @@ -333,7 +333,7 @@ window.app = createApp({ safe: '' }, tabs: { - expanded: {icon: 'expanded alternate', label: 'Expanded'}, + expanded: {icon: 'expand alternate', label: 'Expanded'}, compacted: {icon: 'compress alternate', label: 'Compacted'}, flattened: {icon: 'bars', label: 'Flattened'}, framed: {icon: 'crop alternate', label: 'Framed'}, @@ -395,6 +395,7 @@ window.app = createApp({ }, // methods async retrieveDoc(_editor, docVar, url) { + if (!url) return; try { const rv = await fetch(url); if (!rv.ok) { @@ -573,7 +574,7 @@ window.app = createApp({ // the `json-ld` parameter can be JSON or a URL const jsonLdOrUrl = hash.get('json-ld'); try { - this.doc = JSON.parse(jsonLdOrUrl); + this.doc = JSON.parse(jsonLdOrUrl) || this.doc; setEditorValue(this.mainEditor, this.doc); } catch { this.remoteDocURL = jsonLdOrUrl; @@ -582,6 +583,6 @@ window.app = createApp({ if (hash.get('copyContext') === 'true') { this.copyContext(); } - this.outputTab = hash.get('startTab')?.slice(4); + this.outputTab = hash.get('startTab')?.slice(4) || this.outputTab; } }).mount(); diff --git a/playground/next/index.html b/playground/next/index.html index b6fdb2e8..3906fbbc 100644 --- a/playground/next/index.html +++ b/playground/next/index.html @@ -109,29 +109,29 @@