@xiee/utils
Advanced tools
Comparing version 1.1.6 to 1.1.7
@@ -1,4 +0,4 @@ | ||
(function() { | ||
(function(d) { | ||
function fix_footnote(tagName) { | ||
var tags = document.getElementsByTagName(tagName), i, tag, tag2, n = 1, href; | ||
let tags = d.getElementsByTagName(tagName), i, tag, tag2, n = 1, href; | ||
for (i = 0; i < tags.length; i++) { | ||
@@ -28,2 +28,6 @@ tag = tags[i]; | ||
fix_footnote('sup'); fix_footnote('li'); | ||
})(); | ||
// move the return symbol into the previous <p> | ||
d.querySelectorAll('.footnotes > ol > li > p ~ .footnote-return').forEach(el => { | ||
el.previousElementSibling.lastChild.after(el); | ||
}); | ||
})(document); |
@@ -13,3 +13,3 @@ // convert <!--# comments --> to <span class="hash-notes">comments</span> | ||
.replace(/\[([^\]]+)\]\(([^)]+)\)/g, '<a href="$2" target="_blank">$1</a>') | ||
.replace(/(?<!")(https?:\/\/)([-a-zA-Z0-9%._#=/\+]+)/g, '<a href="$1$2" target="_blank">$2</a>'); | ||
.replace(/(^|[^"])(https?:\/\/)([-a-zA-Z0-9%._=/\+]+)(#)?([-a-zA-Z0-9%._=\+]+)?/g, '$1<a href="$2$3$4$5" target="_blank">$3$4</a>'); | ||
el.before(s); | ||
@@ -16,0 +16,0 @@ el.remove(); |
{ | ||
"name": "@xiee/utils", | ||
"version": "1.1.6", | ||
"version": "1.1.7", | ||
"description": "Miscellaneous tools and utilities to manipulate HTML pages", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
14375
285