Skip to content

Commit

Permalink
Symbols, such as '[]{}', must not be included between html tags.
Browse files Browse the repository at this point in the history
Symbols, such as '[]{}', must not be included between html tags.
  • Loading branch information
kieat committed Oct 2, 2018
1 parent 301eab5 commit 9a91db1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Expand Up @@ -77,14 +77,14 @@ module.exports = function (doc, styleFile) {
return '<span ' + style('json-markup-string') + '>"<a href="' + escape(obj) + '">' + escape(obj) + '</a>"</span>'

case 'array':
return forEach(obj, '[', ']', visit)
return forEach(obj, '', '', visit)

case 'object':
var keys = Object.keys(obj).filter(function (key) {
return obj[key] !== undefined
})

return forEach(keys, '{', '}', function (key) {
return forEach(keys, '', '', function (key) {
return '<span ' + style('json-markup-key') + '>"' + key + '":</span> ' + visit(obj[key])
})
}
Expand Down

2 comments on commit 9a91db1

@wubzz
Copy link
Contributor

@wubzz wubzz commented on 9a91db1 Oct 16, 2018

Choose a reason for hiding this comment

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

May I ask what the reasoning behind this change was? I would understand an option, but completely removing it?

The markup looks very awkward without {} / [].

@Kikobeats
Copy link
Collaborator

Choose a reason for hiding this comment

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

feeling you're right, can you make a PR? 🙂

Please sign in to comment.