From b13cf2e049bfcd493c0a7a54a89a521556224662 Mon Sep 17 00:00:00 2001 From: Joe Hildebrand Date: Thu, 16 Mar 2023 15:02:10 -0600 Subject: [PATCH 1/4] Make online version work in old browsers. Fixes #371. --- docs/css/content.css | 5 +++-- docs/js/online.js | 3 ++- docs/online.html | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/css/content.css b/docs/css/content.css index 105b79e3..8ad14887 100644 --- a/docs/css/content.css +++ b/docs/css/content.css @@ -124,13 +124,14 @@ #content #output-header { margin: 1.25em 0 0 0; border: none; padding: .25em 1.2em .25em 1.2em; font-size: 80%; - color: white; background-color: silver; + color: black; + background-color: #f0f0f0; } #content #output { overflow: auto; max-height: 20em; margin: 0; padding: .5em 1em; border: 2px solid silver; border-top: none; - background-color: #f0f0f0; + background-color: silver; } #content #output.disabled { color: gray; } diff --git a/docs/js/online.js b/docs/js/online.js index d325c5dc..5ac2ddd9 100644 --- a/docs/js/online.js +++ b/docs/js/online.js @@ -165,12 +165,13 @@ $(document).ready(function() { newInput.length, timeAfter - timeBefore )); - $("#output").removeClass("disabled").text(util.inspect(output, { + $("#output").removeClass("disabled").html(util.inspect(output, { depth: Infinity, color: false, maxArrayLength: Infinity, maxStringLength: Infinity, compact: false, + stylize: util.stylizeWithHTML, })); var result = true; diff --git a/docs/online.html b/docs/online.html index 22aea553..70ad33b6 100644 --- a/docs/online.html +++ b/docs/online.html @@ -11,7 +11,7 @@ scripts: [ "https://unpkg.com/jquery@1.12.4/dist/jquery.min.js", "https://unpkg.com/file-saver@2.0.2/dist/FileSaver.min.js", - "https://unpkg.com/node-inspect-extracted@1.1.0/dist/inspect.js", + "https://unpkg.com/node-inspect-extracted@2.0.1/dist/inspect.js", "/vendor/peggy/peggy.min.js", "/vendor/codemirror/codemirror.js", "/vendor/codemirror/lint.js", From 78e65e47c6052ab820313aec996e3d25da1299c5 Mon Sep 17 00:00:00 2001 From: Joe Hildebrand Date: Thu, 16 Mar 2023 15:29:14 -0600 Subject: [PATCH 2/4] Update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fc6191f6..14577e6d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ Released: TBD ### Bug Fixes +- [#371](https://github.com/peggyjs/peggy/issues/371) Error using online Peggy - Can't find variable: util - [#374](https://github.com/peggyjs/peggy/issues/374) CLI throws exception on grammar errors. From @hildjj From 3e76bdbd16798b05fa82c5ec4cf6c10d5fdd5baa Mon Sep 17 00:00:00 2001 From: Joe Hildebrand Date: Thu, 16 Mar 2023 18:36:42 -0600 Subject: [PATCH 3/4] Update to node-inspect-extracted@2.0.2 --- docs/online.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/online.html b/docs/online.html index 70ad33b6..5764f3de 100644 --- a/docs/online.html +++ b/docs/online.html @@ -11,7 +11,7 @@ scripts: [ "https://unpkg.com/jquery@1.12.4/dist/jquery.min.js", "https://unpkg.com/file-saver@2.0.2/dist/FileSaver.min.js", - "https://unpkg.com/node-inspect-extracted@2.0.1/dist/inspect.js", + "https://unpkg.com/node-inspect-extracted@2.0.2/dist/inspect.js", "/vendor/peggy/peggy.min.js", "/vendor/codemirror/codemirror.js", "/vendor/codemirror/lint.js", From d1dbaa7b0673acdc3eaee82915e3f4c66125c117 Mon Sep 17 00:00:00 2001 From: Joe Hildebrand Date: Thu, 16 Mar 2023 18:43:30 -0600 Subject: [PATCH 4/4] Change silver to hex --- docs/css/content.css | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/css/content.css b/docs/css/content.css index 8ad14887..ba3ff1fe 100644 --- a/docs/css/content.css +++ b/docs/css/content.css @@ -1,6 +1,6 @@ #content h1 { margin: 0 0 .75em 0; font-size: 200%; } #content h2 { - margin: 1.5em 0 .75em 0; border-bottom: 2pt dotted silver; + margin: 1.5em 0 .75em 0; border-bottom: 2pt dotted #c0c0c0; font-size: 150%; } #content h3 { margin: 1.5em 0 .5em 0; font-size: 125%; } @@ -10,7 +10,7 @@ #content aside.info { margin: 1em 0 1em 2em; color: gray; } #content pre { overflow: auto; - padding: .5em 1em; border-left: 5px solid silver; + padding: .5em 1em; border-left: 5px solid #c0c0c0; background-color: #f0f0f0; } #content table { border-spacing: 0; } @@ -130,8 +130,8 @@ #content #output { overflow: auto; max-height: 20em; - margin: 0; padding: .5em 1em; border: 2px solid silver; border-top: none; - background-color: silver; + margin: 0; padding: .5em 1em; border: 2px solid #c0c0c0; border-top: none; + background-color: #c0c0c0; } #content #output.disabled { color: gray; }