您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Removes awkward double spaces between paragraphs on AO3.
当前为
// ==UserScript== // @name AO3 Remove Double-Spacing // @namespace ao3-remove-double-spacing // @version 1.0 // @description Removes awkward double spaces between paragraphs on AO3. // @author yuube // @match http*://*.archiveofourown.org/works/* // @grant none // ==/UserScript== function hideEmptyElement (el) { var content = el.textContent && el.textContent.trim().replace(' ', '') if (!content) { el.style.display = 'none' } } var chapters = document.querySelector('#chapters') // Remove empty paragraphs chapters.querySelectorAll('p').forEach(hideEmptyElement); // Remove empty divs chapters.querySelectorAll('div').forEach(hideEmptyElement); // Remove any other empty elements (won't catch many cases) chapters.querySelectorAll(':empty').forEach(hideEmptyElement); // Remove excessive line breaks (replaces 2 or more <br />s with one) chapters.innerHTML = chapters.innerHTML.replace(/(<br\s*\/?>){3,}/gi, '<br>');