@xiee/utils
Advanced tools
Comparing version 1.2.4 to 1.2.6
@@ -1,8 +0,13 @@ | ||
(function() { | ||
var links = document.getElementsByTagName('a'); | ||
for (var i = 0; i < links.length; i++) { | ||
if (/^(https?:)?\/\//.test(links[i].getAttribute('href'))) { | ||
links[i].target = '_blank'; | ||
(function(d) { | ||
const r = /^(https?:)?\/\//; | ||
d.querySelectorAll('a').forEach(a => { | ||
// add _blank target to external links | ||
if (r.test(a.getAttribute('href'))) { | ||
a.target = '_blank'; | ||
} | ||
} | ||
})(); | ||
// shorten bare links | ||
if (a.childElementCount === 0) { | ||
a.innerText = a.innerText.replace(r, '').replace(/#.*$/, ''); | ||
} | ||
}) | ||
})(document); |
{ | ||
"name": "@xiee/utils", | ||
"version": "1.2.4", | ||
"version": "1.2.6", | ||
"description": "Miscellaneous tools and utilities to manipulate HTML pages", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -73,2 +73,9 @@ This repo contains miscellaneous tools and utilities written in JavaScript. They | ||
## key-buttons.js | ||
Find keyboard keys in `<code></code>` and convert the tag to `<kbd></kbd>`, | ||
e.g., convert `<code>Ctrl + C</code>` to `<kbd>Ctrl</kbd>` + `<kbd>C</kbd>`. | ||
With `key-buttons.css`, the keys will be styled as boxes with shadows like | ||
buttons. | ||
## load-highlight.js | ||
@@ -75,0 +82,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23950
25
517
101