File tree Expand file tree Collapse file tree 1 file changed +1
-2
lines changed
extension/src/json-viewer Expand file tree Collapse file tree 1 file changed +1
-2
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ function allTextNodes(nodes) {
99function getPreWithSource ( ) {
1010 var childNodes = document . body . childNodes ;
1111
12- if ( childNodes . length > 1 && childNodes [ 0 ] . nodeName === "#text" ) {
1312 if ( childNodes . length > 1 && allTextNodes ( childNodes ) ) {
1413 if ( process . env . NODE_ENV === 'development' ) {
1514 console . debug ( "[JSONViewer] Loaded from a multiple text nodes, normalizing" ) ;
@@ -27,7 +26,7 @@ function getPreWithSource() {
2726 return childNode ;
2827
2928 // if Content-Type is text/html
30- } else if ( nodeName === "#text" && ! / ^ \s + $ / g . test ( textContent ) ) {
29+ } else if ( nodeName === "#text" && textContent . trim ( ) . length > 0 ) {
3130 if ( process . env . NODE_ENV === 'development' ) {
3231 console . debug ( "[JSONViewer] Loaded from a text node, this might have returned content-type: text/html" ) ;
3332 }
You can’t perform that action at this time.
0 commit comments