From a483290a456f1e18101fd0fc84a49e5abb2ea2e1 Mon Sep 17 00:00:00 2001 From: jbshirk Date: Fri, 13 Nov 2015 13:53:38 -0500 Subject: [PATCH] set window title to first h1 or h2 set window title to first h1 or h2. This does not affect the hard-coded head title that appears in the top bar of the app, and therefore does not affect metadata that is sucked into social network postings. It probably also does not affect search/SEO. --- webapps/markdown-viewer/mdown | 3 +++ 1 file changed, 3 insertions(+) diff --git a/webapps/markdown-viewer/mdown b/webapps/markdown-viewer/mdown index e077947..ac4dede 100644 --- a/webapps/markdown-viewer/mdown +++ b/webapps/markdown-viewer/mdown @@ -47,6 +47,9 @@ function render(path) { .removeClass('navbar-fixed-top') $('#loading').hide() + + // set window title to first h1 or h2 in markdown text + document.title = document.querySelector("h1, h2").textContent; }) }