Skip to content
This repository was archived by the owner on Aug 12, 2020. It is now read-only.

Commit e7b8840

Browse files
author
Lars Gierth
authored
Merge pull request #40 from jbshirk/master
set window title to first h1 or h2
2 parents a9bf5a0 + a483290 commit e7b8840

File tree

1 file changed

+3
-0
lines changed
  • webapps/markdown-viewer

1 file changed

+3
-0
lines changed

webapps/markdown-viewer/mdown

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ function render(path) {
4747
.removeClass('navbar-fixed-top')
4848

4949
$('#loading').hide()
50+
51+
// set window title to first h1 or h2 in markdown text
52+
document.title = document.querySelector("h1, h2").textContent;
5053
})
5154
}
5255

0 commit comments

Comments
 (0)