From f390aba9a2d296da812d789ff054094bdf108b71 Mon Sep 17 00:00:00 2001 From: Andrew Lloyd Cartwright Date: Sun, 21 Jun 2020 17:28:18 -0500 Subject: [PATCH] Strip HTML tags from ToC element with regex before showing in title bar (#1120) --- source/javascripts/app/_toc.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/javascripts/app/_toc.js b/source/javascripts/app/_toc.js index 6bb3bc9..f70bdc0 100644 --- a/source/javascripts/app/_toc.js +++ b/source/javascripts/app/_toc.js @@ -80,9 +80,9 @@ if (window.history.replaceState) { window.history.replaceState(null, "", best); } - var thisTitle = $best.data("title") + var thisTitle = $best.data("title"); if (thisTitle !== undefined && thisTitle.length > 0) { - document.title = thisTitle + " – " + originalTitle; + document.title = thisTitle.replace(htmlPattern, "") + " – " + originalTitle; } else { document.title = originalTitle; }