Greasy Fork is available in English.
自动对信件的段落进行划分,使段落间有明显的间隔更便于阅读。触发条件是鼠标点击或者键盘按键,一般情况下可以无感触发。
当前为
// ==UserScript==
// @name Slowly 段落划分
// @namespace Slowly Segmentation
// @match https://web.slowly.app/friend/*
// @grant none
// @version 0.0.1
// @author 稻米鼠
// @created 2021/2/16 下午2:23:14
// @update 2021/2/16 下午2:23:14
// @description 自动对信件的段落进行划分,使段落间有明显的间隔更便于阅读。触发条件是鼠标点击或者键盘按键,一般情况下可以无感触发。
// ==/UserScript==
const segmentation = ()=>{
if(window.location.hash && window.location.hash === '#Segmented') return
if(!/friend\/\w+\/\w+\//.test(window.location.href)) return
document.body.querySelector('#root .friend-Letter-wrapper .letter .modal-body > .pre-wrap').innerHTML = '<p>' + document.body.querySelector('#root .friend-Letter-wrapper .letter .modal-body > .pre-wrap').innerHTML.split(/\n+/).join('</p><p>')+'</p>'
window.location.hash = '#Segmented'
}
window.addEventListener('click', segmentation)
window.addEventListener('keydown', segmentation)