@xiee/utils
Advanced tools
Comparing version 1.6.6 to 1.6.7
[...document.getElementsByTagName('img')].forEach(el => { | ||
if (!el.title) el.title = el.alt; | ||
if (el.alt) { | ||
el.alt = el.alt.replace(/\n/g, ' '); | ||
if (!el.title) el.title = el.alt; | ||
} | ||
}); |
@@ -1,1 +0,1 @@ | ||
[...document.getElementsByTagName("img")].forEach((t=>{t.title||(t.title=t.alt)})); | ||
[...document.getElementsByTagName("img")].forEach((t=>{t.alt&&(t.alt=t.alt.replace(/\n/g," "),t.title||(t.title=t.alt))})); |
(d => { | ||
const r = /^(https?:)?\/\//; | ||
d.querySelectorAll('a').forEach(a => { | ||
if (!a.title) a.title = a.href; | ||
if (!r.test(a.getAttribute('href'))) return; | ||
@@ -5,0 +6,0 @@ // add _blank target to external links |
@@ -1,1 +0,1 @@ | ||
(e=>{const t=/^(https?:)?\/\//;e.querySelectorAll("a").forEach((e=>{t.test(e.getAttribute("href"))&&(e.target="_blank",0===e.childElementCount&&t.test(e.innerText)&&(e.innerText=e.innerText.replace(t,"").replace(/(.+)#.*$/,"$1")))}))})(document); | ||
(e=>{const t=/^(https?:)?\/\//;e.querySelectorAll("a").forEach((e=>{e.title||(e.title=e.href),t.test(e.getAttribute("href"))&&(e.target="_blank",0===e.childElementCount&&t.test(e.innerText)&&(e.innerText=e.innerText.replace(t,"").replace(/(.+)#.*$/,"$1")))}))})(document); |
{ | ||
"name": "@xiee/utils", | ||
"version": "1.6.6", | ||
"version": "1.6.7", | ||
"description": "Miscellaneous tools and utilities to manipulate HTML pages", | ||
@@ -5,0 +5,0 @@ "scripts": { |
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
70997
1119