summaryrefslogtreecommitdiff
path: root/src/text/html.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/text/html.ts')
-rw-r--r--src/text/html.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/text/html.ts b/src/text/html.ts
index 797f3b3f33..f33ef4997b 100644
--- a/src/text/html.ts
+++ b/src/text/html.ts
@@ -54,6 +54,12 @@ const handlers = {
document.body.appendChild(blockquote);
},
+ title({ document }, { content }) {
+ const h1 = document.createElement('h1');
+ h1.textContent = content;
+ document.body.appendChild(h1);
+ },
+
text({ document }, { content }) {
for (const text of content.split('\n')) {
const node = document.createTextNode(text);
@@ -69,6 +75,13 @@ const handlers = {
a.href = url;
a.textContent = url;
document.body.appendChild(a);
+ },
+
+ search({ document }, { content, query }) {
+ const a = document.createElement('a');
+ a.href = `https://www.google.com/?#q=${query}`;
+ a.textContent = content;
+ document.body.appendChild(a);
}
};