From a06789afcc5b53c34d19d2d9d35c3b91c705d91c Mon Sep 17 00:00:00 2001 From: cel Date: Fri, 5 May 2017 18:52:46 -1000 Subject: check ref is string --- lib/util.js | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/util.js') diff --git a/lib/util.js b/lib/util.js index 0a6356c..90fc55a 100644 --- a/lib/util.js +++ b/lib/util.js @@ -6,6 +6,7 @@ var u = exports u.ssbRefRegex = /((?:@|%|&|ssb:\/\/%)[A-Za-z0-9\/+]{43}=\.[\w\d]+)/g u.isRef = function (str) { + if (!str) return false u.ssbRefRegex.lastIndex = 0 return u.ssbRefRegex.test(str) } -- cgit v1.2.3 From bc37b05926f3b5acff7905748607f4f0da5ac14e Mon Sep 17 00:00:00 2001 From: cel Date: Sat, 6 May 2017 17:37:42 -1000 Subject: Put shortcut icon in correct place --- lib/serve.js | 1 + lib/util.js | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/util.js') diff --git a/lib/serve.js b/lib/serve.js index bce474c..d9cbfe7 100644 --- a/lib/serve.js +++ b/lib/serve.js @@ -987,6 +987,7 @@ Serve.prototype.wrapPage = function (title, searchQ) { h('meta', {charset: 'utf-8'}), h('title', title), h('meta', {name: 'viewport', content: 'width=device-width,initial-scale=1'}), + h('link', {rel: 'icon', href: render.toUrl('/static/hermie.ico'), type: 'image/x-icon'}), h('style', styles()) ), h('body', diff --git a/lib/util.js b/lib/util.js index 90fc55a..6a419f9 100644 --- a/lib/util.js +++ b/lib/util.js @@ -38,9 +38,7 @@ u.toHTML = function (el) { if (typeof el === 'string' || Array.isArray(el)) { return h('div', el).innerHTML } - var html = el.outerHTML || String(el) - if (el.nodeName === 'html') html = '' + html + '\n' - return html + return el.outerHTML || String(el) } u.hyperwrap = function (fn) { -- cgit v1.2.3 From f13fbed3ce0247e55561b3dbe35819c672958cd7 Mon Sep 17 00:00:00 2001 From: cel Date: Sun, 7 May 2017 09:29:25 -1000 Subject: Add back doctype --- lib/util.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/util.js') diff --git a/lib/util.js b/lib/util.js index 6a419f9..fe5b4f3 100644 --- a/lib/util.js +++ b/lib/util.js @@ -38,7 +38,9 @@ u.toHTML = function (el) { if (typeof el === 'string' || Array.isArray(el)) { return h('div', el).innerHTML } - return el.outerHTML || String(el) + var html = el.outerHTML || String(el) + if (el.nodeName === 'html') html = '' + html + '\n' + return html } u.hyperwrap = function (fn) { -- cgit v1.2.3