Skip to content

Commit

Permalink
Replace break element with new line
Browse files Browse the repository at this point in the history
  • Loading branch information
evmiguel committed Feb 29, 2024
1 parent 20a1d2e commit 7b89970
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions content/shared/js/examples.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ aria.widget.SourceCode.prototype.createCode = function (
var openTag = '';
var nodeNameStr = node.nodeName.toLowerCase();

openTag += '<br/>' + indentation(indentLevel) + '&lt;' + nodeNameStr;
openTag += '\n' + indentation(indentLevel) + '&lt;' + nodeNameStr;

var wrapAttributes = node.attributes.length > 2;

Expand All @@ -143,7 +143,7 @@ aria.widget.SourceCode.prototype.createCode = function (
node.attributes[attrPos].nodeName + '="' + attributeValue + '"';

if (wrapAttributes && attrPos !== node.attributes.length - 1) {
openTag += '<br/>' + indentation(indentLevel);
openTag += '\n' + indentation(indentLevel);
openTag += '&nbsp;'.repeat(nodeNameStr.length + 2);
}
}
Expand Down Expand Up @@ -173,7 +173,7 @@ aria.widget.SourceCode.prototype.createCode = function (
indentation(indentLevel)
);

sourceCodeNode.innerHTML += '<br/>' + textNodeContent;
sourceCodeNode.innerHTML += '\n' + textNodeContent;
}
break;

Expand All @@ -186,7 +186,7 @@ aria.widget.SourceCode.prototype.createCode = function (
indentation(indentLevel)
);

sourceCodeNode.innerHTML += '<br/>' + commentNodeContent;
sourceCodeNode.innerHTML += '\n' + commentNodeContent;
}
break;
}
Expand All @@ -198,7 +198,7 @@ aria.widget.SourceCode.prototype.createCode = function (
var closeTag = '&lt;/' + node.nodeName.toLowerCase() + '&gt;';

if (node.childNodes.length > 0) {
sourceCodeNode.innerHTML += '<br/>' + indentation(indentLevel);
sourceCodeNode.innerHTML += '\n' + indentation(indentLevel);
}

sourceCodeNode.innerHTML += closeTag;
Expand Down

0 comments on commit 7b89970

Please sign in to comment.