Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save lolicsystem/2899668 to your computer and use it in GitHub Desktop.
Save lolicsystem/2899668 to your computer and use it in GitHub Desktop.
アメブロ本文中の過剰な改行を削除するグリモン
// ==UserScript==
// @name remove plural br-tag from ameblo
// @namespace http://lolicsystem.com/gm_scripts/
// @description アメブロ本文中の過剰な改行を削除します
// @include http://ameblo.jp/*
// @author lolicsystem
// @version 1
// ==/UserScript==
(function () {
var a = document.evaluate('//div[@class="articleText"]', document.body, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
for (var i = 0; i < a.snapshotLength; i++) {
a.snapshotItem(i).innerHTML = a.snapshotItem(i).innerHTML.replace(/(<br>){3,}/ig, "<br>");
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment