summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOmar Rizwan <omar@omar.website>2021-08-16 16:51:39 -0700
committerOmar Rizwan <omar@omar.website>2021-08-16 16:51:39 -0700
commit37cdd270bda69ee16a6328ee0a15e813b49a38a3 (patch)
tree12457f70514f75ba2d06838cf479a308d2421ba0
parenta6d2df419385a0896eff28c10c98e04e337a0aac (diff)
downloadTabFS-37cdd270bda69ee16a6328ee0a15e813b49a38a3.tar.gz
TabFS-37cdd270bda69ee16a6328ee0a15e813b49a38a3.zip
extension: Clean up routes.html formatting a bit.
-rw-r--r--extension/background.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/extension/background.js b/extension/background.js
index aa7a4de..e4f655e 100644
--- a/extension/background.js
+++ b/extension/background.js
@@ -697,10 +697,13 @@ Routes["/runtime/routes.html"] = makeRouteWithContents(async () => {
</ul>
</dd>` : '<dd style="background-color: #f99">No usage found!</dd>'}
${lineRange ?
- `<details>
- <summary>Source code (<a href="https://github.com/osnr/TabFS/blob/master/extension/background.js#L${lineRange[0]}-L${lineRange[1]}">on GitHub</a>)
- <pre>${jsLines[lineRange[0] - 1]}</pre>
- </details>` : '<dd style="background-color: #f99">No source code found!</dd>'}
+ `<dd><details>
+ <summary>Source code (<a href="https://github.com/osnr/TabFS/blob/master/extension/background.js#L${lineRange[0]}-L${lineRange[1]}">on GitHub</a>)</summary>
+ <pre><code>${
+ jsLines[lineRange[0] - 1]
+ // FIXME: get entire range; escape for HTML
+ }</code></pre>
+ </details></dd>` : '<dd style="background-color: #f99">No source code found!</dd>'}
`;
}).join('\n') + `
</dl>