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

set window title to first h1 or h2 #40

Merged
1 commit merged into from
Oct 28, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions webapps/markdown-viewer/mdown
Original file line number Diff line number Diff line change
Expand Up @@ -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;
})
}

Expand Down