ushistory.org summarizer - bruh im not bouta read all dat

extracts bolded words & cooresponding paragraphs and underlines them in the browser console. also outputs a list of all the bolded words

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         ushistory.org summarizer - bruh im not bouta read all dat
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  extracts bolded words & cooresponding paragraphs and underlines them in the browser console. also outputs a list of all the bolded words
// @author       You
// @include      *://*.ushistory.org/us/*
// @include      *://*.ushistory.org/gov/*
// @include      *://*.ushistory.org/civ/*
// @exclude      *://*.ushistory.org/*/index.asp
// @grant        none
// @run-at       document-end
// ==/UserScript==

(function() {
    'use strict';
    var terms=[...document.querySelectorAll(".term")],
        textterms=terms.map(a=>a.innerText),
        termsents=terms.map((a,i,w)=>(((i-1>=0&&w[i-1].nextSibling==a.previousSibling)||a.previousSibling==null)?"":("\n\n|~|N%c"+a.previousSibling.textContent))+"|~|B%c"+a.innerText+"|~|N%c"+a.nextSibling.textContent);
    console.log(textterms.join("\n"));
    console.log("\n\n");
    var newarra=[],
        newarrb=[];
    termsents.join("").split("|~|").forEach(a=>{
        newarra.push(a.slice(1));
        newarrb.push(a.startsWith("B")?"font-weight:bold;text-decoration:underline;":"");
    });
    if(["","\n","\n\n"].includes(newarra[0])){
        newarra.shift();
        newarrb.shift();
    }
    console.log(newarra.join(""),...newarrb);
})();