docs: Minor JSON docs bugfix for hiding a header, remove invalid comment (#87)

This commit is contained in:
Francis Lavoie 2020-09-25 17:33:02 -04:00 committed by GitHub
parent af3676862b
commit 05fa4bcca1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 6 deletions

View file

@ -10,7 +10,7 @@
<div id="top-doc"> <div id="top-doc">
<!--Populated by JS--> <!--Populated by JS-->
</div> </div>
<h2 id="field-list">Field List</h2> <h2 id="field-list-header">Field List</h2>
<dl id="field-list-contents"> <dl id="field-list-contents">
<!--Populated by JS--> <!--Populated by JS-->
</dl> </dl>

View file

@ -179,8 +179,8 @@ function beginRendering(json) {
renderData(pageData.structure, 0, "", $('<div class="group"/>')); renderData(pageData.structure, 0, "", $('<div class="group"/>'));
console.log("DOCS:", pageDocs); console.log("DOCS:", pageDocs);
if ($('#field-list-contents').html().trim()) { if ($('#field-list-contents').text().trim()) {
$('#field-list').show(); $('#field-list-header').show();
} }
// if the browser tried to navigate directly to an element // if the browser tried to navigate directly to an element

View file

@ -50,9 +50,8 @@ $(function() {
}); });
// Add links to [<matcher>] or named matcher tokens in code blocks. // Add links to [<matcher>] or named matcher tokens in code blocks.
// We can't do it exactly the same as the above block, because // The matcher text includes <> characters which are parsed as HTML,
// the matcher text includes <> character which are parsed as HTML // so we must use text() to change the link text.
// unless we use text() to change the link text.
$('pre.chroma .nd') $('pre.chroma .nd')
.map(function(k, item) { .map(function(k, item) {
let text = item.innerText; let text = item.innerText;