mirror of
https://github.com/skoelle/buildbroken-blog-archive.git
synced 2026-09-17 18:30:25 +00:00
link replacer on excerpt
This commit is contained in:
@@ -30,9 +30,10 @@
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
var content = document.querySelector(".post-content");
|
var containers = document.querySelectorAll(".post-content, .about-intro, .excerpt");
|
||||||
if (!content) return;
|
if (!containers.length) return;
|
||||||
|
|
||||||
|
Array.prototype.forEach.call(containers, function (content) {
|
||||||
var links = content.querySelectorAll("a[href^='http']");
|
var links = content.querySelectorAll("a[href^='http']");
|
||||||
Array.prototype.forEach.call(links, function (a) {
|
Array.prototype.forEach.call(links, function (a) {
|
||||||
var href = a.getAttribute("href");
|
var href = a.getAttribute("href");
|
||||||
@@ -55,6 +56,7 @@
|
|||||||
if (rep) a.setAttribute("href", rep);
|
if (rep) a.setAttribute("href", rep);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
if (dialog) {
|
if (dialog) {
|
||||||
dialog.addEventListener("click", function (ev) {
|
dialog.addEventListener("click", function (ev) {
|
||||||
|
|||||||
Reference in New Issue
Block a user