您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Remove empty paragraphs and leading/trailing breaks in AO3 works.
当前为
// ==UserScript== // @name AO3 Remove gaps between paragraphs // @description Remove empty paragraphs and leading/trailing breaks in AO3 works. // @author C89sd // @version 1.0 // @match https://archiveofourown.org/works/* // @namespace https://greasyfork.org/users/1376767 // ==/UserScript== // Testing: // p.innerHTML = " \t\n " // https://archiveofourown.org/works/63851347 empty <p> // https://archiveofourown.org/works/13439460 leading <br> // https://archiveofourown.org/works/5191202?view_full_work=true formatting const isEmpty = /^\s*$/; const ps = document.querySelectorAll('div#workskin p'); for (const p of ps) { if (isEmpty.test(p.textContent)) p.remove(); while (p.firstChild && p.firstChild.nodeName === 'BR') p.removeChild(p.firstChild); while (p.lastChild && p.lastChild.nodeName === 'BR') p.removeChild(p.lastChild); }