您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
修正百家号文章的层级,配合copy as markdown插件食用
// ==UserScript== // @name 百家号文章标题h[x]层级标准化 // @namespace https://mbd.baidu.com // @version 0.2 // @description 修正百家号文章的层级,配合copy as markdown插件食用 // @author dexfire // @icon https://q2.qlogo.cn/headimg_dl?dst_uin=275176629&spec=5 // @match https://mbd.baidu.com/newspage/* // @grant none // ==/UserScript== (function() { 'use strict'; // Your code here... // replace the Elements with $(src) with a tag with type of dist. // such as `replace_tag('bjh-h3', 'h3')` function replace_tag(src, dist){ var jsrc = $('.' + src); jsrc.each(function(){ var e = $(this); var p = $('<p></p>'); var jdist = $('<' + dist + ' class="' + src + '"></' + dist +'>'); jdist.append(e.contents()); p.append(jdist); if (e.parent() !== null){ e.parent().after(p); e.parent().remove(); } }); } replace_tag('bjh-h3', 'h2'); replace_tag('bjh-blockquote', 'quote'); })();