mirror of
https://github.com/aljazceru/njump.git
synced 2026-01-30 19:24:30 +01:00
Update json styles
This commit is contained in:
@@ -85,13 +85,17 @@ function syntaxHighlight(json) {
|
||||
json = json.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>')
|
||||
return json.replace(
|
||||
/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g,
|
||||
function (match) {
|
||||
function (match, p1) {
|
||||
var cls = 'number'
|
||||
if (/^"/.test(match)) {
|
||||
if (/:$/.test(match)) {
|
||||
cls = 'key'
|
||||
} else {
|
||||
cls = 'string'
|
||||
if (p1.length < 100) {
|
||||
cls = 'string'
|
||||
} else {
|
||||
cls = 'string content'
|
||||
}
|
||||
}
|
||||
} else if (/true|false/.test(match)) {
|
||||
cls = 'boolean'
|
||||
|
||||
Reference in New Issue
Block a user