accessibility: replace <tt> with appropriate tags
<tt> is a "non-conforming feature". It is "entirely obsolete, and must not be used by authors" as specified in https://www.w3.org/TR/html51/obsolete.html#elementdef-tt. This PR replaces <tt> with either <code> or <kbd> as suggested in the above recommendation. Practically, it improves accessibility of the page, allowing screen readers to understand the document more accurately. Note that both <code> and <kbd> are recognized in older browsers already, so this PR doesn't cause any incompatibility issue.
This commit is contained in:
parent
b3e27ca69c
commit
93e280c042
|
@ -71,7 +71,7 @@ function MakeContextQueryItem(qry, desc) {
|
||||||
+' onclick="return new_query(this,\''
|
+' onclick="return new_query(this,\''
|
||||||
+encodeURIComponent(desc)
|
+encodeURIComponent(desc)
|
||||||
+'\');">'
|
+'\');">'
|
||||||
+ desc.replace(/{{/g, "<tt><b>").replace(/}}/g, "</b></tt>")
|
+ desc.replace(/{{/g, "<code><b>").replace(/}}/g, "</b></code>")
|
||||||
+ '</a></li>';
|
+ '</a></li>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,34 +112,34 @@ function InitializeSearch() {
|
||||||
+'</div>'
|
+'</div>'
|
||||||
+'<div id="help_panel" '+panelstyle+'>'
|
+'<div id="help_panel" '+panelstyle+'>'
|
||||||
+'<ul style="padding: 0em; margin: 0.5em 1.5em;">'
|
+'<ul style="padding: 0em; margin: 0.5em 1.5em;">'
|
||||||
+'<li>Hit <tt>PageUp</tt>/<tt>PageDown</tt> or'
|
+'<li>Hit <kbd>PageUp</kbd>/<kbd>PageDown</kbd> or'
|
||||||
+' <tt>C+Enter</tt>/<tt>S+C+Enter</tt> to scroll through the'
|
+' <kbd>Ctrl</kbd>+<kbd>Enter</kbd> / <kbd>Shift</kbd>+<kbd>Ctrl</kbd>+<kbd>Enter</kbd>'
|
||||||
+' results.</li>'
|
+' to scroll through the results.</li>'
|
||||||
+'<li>Search terms are all required, use'
|
+'<li>Search terms are all required, use'
|
||||||
+' “<tt>N:<i>str</i></tt>” to negate a term.'
|
+' “<kbd>N:<i>str</i></kbd>” to negate a term.'
|
||||||
+'<li>Use “<tt>M:<i>str</i></tt>” to match only'
|
+'<li>Use “<kbd>M:<i>str</i></kbd>” to match only'
|
||||||
+' identifiers from modules that (partially) match'
|
+' identifiers from modules that (partially) match'
|
||||||
+' “<tt><i>str</i></tt>”; “<tt>M:</tt>” by'
|
+' “<kbd><i>str</i></kbd>”; “<kbd>M:</kbd>” by'
|
||||||
+' itself will restrict results to bound names only.</li>'
|
+' itself will restrict results to bound names only.</li>'
|
||||||
+'<li>Use “<tt>H:<i>str</i></tt>” to match only'
|
+'<li>Use “<kbd>H:<i>str</i></kbd>” to match only'
|
||||||
+' modules that implement a language'
|
+' modules that implement a language'
|
||||||
+' “<tt>#lang <i>str</i></tt>”.</li>'
|
+' “<kbd>#lang <i>str</i></kbd>”.</li>'
|
||||||
+'<li>Use “<tt>R:<i>str</i></tt>” to match only'
|
+'<li>Use “<kbd>R:<i>str</i></kbd>” to match only'
|
||||||
+' modules that implement a reader module'
|
+' modules that implement a reader module'
|
||||||
+' “<tt>#reader <i>str</i></tt>”.</li>'
|
+' “<kbd>#reader <i>str</i></kbd>”.</li>'
|
||||||
+'<li>“<tt>L:<i>str</i></tt>” is similar to'
|
+'<li>“<kbd>L:<i>str</i></kbd>” is similar to'
|
||||||
+' “<tt>M:<i>str</i></tt>”, but'
|
+' “<kbd>M:<i>str</i></kbd>”, but'
|
||||||
+' “<tt><i>str</i></tt>” should match the module name'
|
+' “<kbd><i>str</i></kbd>” should match the module name'
|
||||||
+' exactly; “<tt>L:</tt>” by'
|
+' exactly; “<kbd>L:</kbd>” by'
|
||||||
+' itself will restrict results to module names only.</li>'
|
+' itself will restrict results to module names only.</li>'
|
||||||
+'<li>“<tt>T:<i>str</i></tt>” restricts results to ones in'
|
+'<li>“<kbd>T:<i>str</i></kbd>” restricts results to ones in'
|
||||||
+' the “<tt><i>str</i></tt>” manual (naming the'
|
+' the “<kbd><i>str</i></kbd>” manual (naming the'
|
||||||
+' directory where the manual is found).</li>'
|
+' directory where the manual is found).</li>'
|
||||||
+'<li>Entries that correspond to bindings have module links that'
|
+'<li>Entries that correspond to bindings have module links that'
|
||||||
+' create a query restricted to bindings in that module (using'
|
+' create a query restricted to bindings in that module (using'
|
||||||
+' “<tt>L:</tt>”), other entries have similar links for'
|
+' “<kbd>L:</kbd>”), other entries have similar links for'
|
||||||
+' restricting results to a specific manual (using'
|
+' restricting results to a specific manual (using'
|
||||||
+' “<tt>T:</tt>”); you can control whether manual links'
|
+' “<kbd>T:</kbd>”); you can control whether manual links'
|
||||||
+' appear (and how) in the preferences.</li>'
|
+' appear (and how) in the preferences.</li>'
|
||||||
+'<li>Right-clicking these links refines the current query instead of'
|
+'<li>Right-clicking these links refines the current query instead of'
|
||||||
+' changing it (but some browsers don\'t support this).</li>'
|
+' changing it (but some browsers don\'t support this).</li>'
|
||||||
|
@ -387,8 +387,8 @@ function SanitizeHTML(str) {
|
||||||
.replace(/>/g, ">")
|
.replace(/>/g, ">")
|
||||||
.replace(/</g, "<")
|
.replace(/</g, "<")
|
||||||
.replace(/\"/g, """)
|
.replace(/\"/g, """)
|
||||||
.replace(/{{/g, "<tt><b>")
|
.replace(/{{/g, "<code><b>")
|
||||||
.replace(/}}/g, "</b></tt>");
|
.replace(/}}/g, "</b></code>");
|
||||||
}
|
}
|
||||||
|
|
||||||
function UrlToManual(url) {
|
function UrlToManual(url) {
|
||||||
|
@ -526,7 +526,7 @@ var indicators =
|
||||||
: (j==i) ? "►"
|
: (j==i) ? "►"
|
||||||
: "·";
|
: "·";
|
||||||
}
|
}
|
||||||
a.push(" <tt>"+s+"</tt>");
|
a.push(" <code>"+s+"</code>");
|
||||||
}
|
}
|
||||||
return a;
|
return a;
|
||||||
}());
|
}());
|
||||||
|
|
Loading…
Reference in New Issue
Block a user