summaryrefslogtreecommitdiff
path: root/src/text/html.ts
diff options
context:
space:
mode:
authorrinsuki <428rinsuki+git@gmail.com>2018-05-17 07:52:24 +0900
committerrinsuki <428rinsuki+git@gmail.com>2018-05-17 07:52:24 +0900
commit829b4012e6dc14eb64a3d8f60826fe9b6a41b40d (patch)
tree42ac37f323db349dca9316e6fdb39fc33b860686 /src/text/html.ts
parentadd yarn.lock to gitignore (diff)
parentUpdate deliver.ts (diff)
downloadmisskey-829b4012e6dc14eb64a3d8f60826fe9b6a41b40d.tar.gz
misskey-829b4012e6dc14eb64a3d8f60826fe9b6a41b40d.tar.bz2
misskey-829b4012e6dc14eb64a3d8f60826fe9b6a41b40d.zip
Merge branch 'master' into fix/yarn-lock-ignore
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);
}
};