您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
在网页正文中的句号后面添加</br>实现换行
// ==UserScript== // @name 遇到句号就添加换行 // @namespace http://tampermonkey.net/ // @version 1.0 // @license MIT // @description 在网页正文中的句号后面添加</br>实现换行 // @author 阿虚同学 // @match *://*/* // @grant none // ==/UserScript== (function() { 'use strict'; // Helper function to add line breaks after Chinese periods function addLineBreaks(node) { if (node.nodeType === Node.TEXT_NODE) { let text = node.nodeValue; let newText = text.replace(/。/g, '。</br>'); let newNode = document.createElement('span'); newNode.innerHTML = newText; node.parentNode.replaceChild(newNode, node); } else if (node.nodeType === Node.ELEMENT_NODE) { for (let child of node.childNodes) { addLineBreaks(child); } } } // Target the main content area of the webpage let contentArea = document.body; // You might want to target a specific element instead of the whole body // Apply the line breaks recursively addLineBreaks(contentArea); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址