Skip to content

Commit

Permalink
Merge pull request #385 from hildjj/fix-371
Browse files Browse the repository at this point in the history
Make online version work in old browsers.
  • Loading branch information
hildjj authored Mar 17, 2023
2 parents d2f5bb9 + d1dbaa7 commit baf7c45
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
11 changes: 6 additions & 5 deletions docs/css/content.css
Original file line number Diff line number Diff line change
@@ -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%; }
Expand All @@ -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; }
Expand Down Expand Up @@ -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;
margin: 0; padding: .5em 1em; border: 2px solid #c0c0c0; border-top: none;
background-color: #c0c0c0;
}
#content #output.disabled { color: gray; }

Expand Down
3 changes: 2 additions & 1 deletion docs/js/online.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion docs/online.html
Original file line number Diff line number Diff line change
Expand Up @@ -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.2/dist/inspect.js",
"/vendor/peggy/peggy.min.js",
"/vendor/codemirror/codemirror.js",
"/vendor/codemirror/lint.js",
Expand Down

0 comments on commit baf7c45

Please sign in to comment.