Add JSON output for unknown root messages
This commit is contained in:
parent
c32b0cd2b5
commit
5e63ad6216
|
@ -12,9 +12,11 @@ const {
|
|||
img,
|
||||
section,
|
||||
span,
|
||||
summary
|
||||
summary,
|
||||
pre
|
||||
} = require('hyperaxe')
|
||||
|
||||
const highlightJs = require('highlight.js')
|
||||
const lodash = require('lodash')
|
||||
|
||||
module.exports = ({ msg }) => {
|
||||
|
@ -70,7 +72,12 @@ module.exports = ({ msg }) => {
|
|||
messageClasses.push('reply')
|
||||
}
|
||||
|
||||
const articleElement = article({ class: 'content', innerHTML: markdownContent })
|
||||
const emptyContent = '<p>undefined</p>\n'
|
||||
const articleElement = markdownContent === emptyContent
|
||||
? article({ class: 'content' }, pre({
|
||||
innerHTML: highlightJs.highlight('json', JSON.stringify(msg, null, 2)).value
|
||||
}))
|
||||
: article({ class: 'content', innerHTML: markdownContent })
|
||||
|
||||
const articleContent = hasContentWarning
|
||||
? details(
|
||||
|
|
Loading…
Reference in New Issue