Skip to content

Commit

Permalink
Merge pull request #217 from ssonal/enhancement-line-number
Browse files Browse the repository at this point in the history
Ignore header while setting line numbers
  • Loading branch information
tulios authored Sep 9, 2022
2 parents 538abc7 + c803023 commit 4195c33
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions extension/src/json-viewer/highlight-content.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ function oversizedJSON(pre, options, outsideViewer) {

function prependHeader(options, outsideViewer, jsonText) {
if (!outsideViewer && options.addons.prependHeader) {
options.structure.firstLineNumber = options.structure.firstLineNumber - 3
var header = "// " + timestamp() + "\n";
header += "// " + document.location.href + "\n\n";
jsonText = header + jsonText;
Expand Down
1 change: 1 addition & 0 deletions extension/src/json-viewer/options/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module.exports = {
structure: {
readOnly: true,
lineNumbers: true,
firstLineNumber: 1,
lineWrapping: true,
foldGutter: true,
tabSize: 2,
Expand Down

1 comment on commit 4195c33

@chirag-soni23
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pull request

Please sign in to comment.