@xiee/utils
Advanced tools
Comparing version 1.3.16 to 1.3.17
@@ -8,3 +8,3 @@ (function(d) { | ||
// shorten bare links | ||
if (a.childElementCount === 0) { | ||
if (a.childElementCount === 0 && r.test(a.innerText)) { | ||
a.innerText = a.innerText.replace(r, '').replace(/(.+)#.*$/, '$1'); | ||
@@ -11,0 +11,0 @@ } |
@@ -1,1 +0,1 @@ | ||
!function(e){const t=/^(https?:)?\/\//;e.querySelectorAll("a").forEach((e=>{t.test(e.getAttribute("href"))&&(e.target="_blank",0===e.childElementCount&&(e.innerText=e.innerText.replace(t,"").replace(/(.+)#.*$/,"$1")))}))}(document); | ||
!function(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); |
// right-align a quote footer if it starts with --- | ||
[...document.getElementsByTagName('blockquote')].forEach(quote => { | ||
const el = quote.lastElementChild; | ||
if (el?.tagName === 'P' && /^(—|---)/.test(el.textContent)) el.style.textAlign = 'right'; | ||
if (el?.tagName === 'P' && /^(—|―|---)/.test(el.textContent)) el.style.textAlign = 'right'; | ||
}); |
@@ -1,1 +0,1 @@ | ||
[...document.getElementsByTagName("blockquote")].forEach((t=>{const e=t.lastElementChild;"P"===e?.tagName&&/^(—|---)/.test(e.textContent)&&(e.style.textAlign="right")})); | ||
[...document.getElementsByTagName("blockquote")].forEach((t=>{const e=t.lastElementChild;"P"===e?.tagName&&/^(—|―|---)/.test(e.textContent)&&(e.style.textAlign="right")})); |
{ | ||
"name": "@xiee/utils", | ||
"version": "1.3.16", | ||
"version": "1.3.17", | ||
"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
52785