Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infrastructure: Fix color contrast failure in HTML source display #2939

Merged
merged 4 commits into from
Apr 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion content/shared/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

(function () {
// Load syntax highlighting
hljs.initHighlightingOnLoad();
hljs.highlightAll();

// Add usage warning to all examples
window.addEventListener('DOMContentLoaded', addExampleUsageWarning, false);
Expand Down
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
Loading
Loading