updated links in MD

This commit is contained in:
MathMan05 2024-09-05 12:03:35 -05:00
parent 04779b6c6c
commit ecbf78b0ff
2 changed files with 21 additions and 16 deletions

View file

@ -510,10 +510,11 @@ class MarkDown {
}
if (partsFound === 2) {
appendcurrent();
i = j;
const parts = build.join("").match(/^\[(.+)\]\((https?:.+?)( ('|").+('|"))?\)$/);
if (parts) {
const linkElem = document.createElement("a");
if (URL.canParse(parts[2])) {
i = j;
MarkDown.safeLink(linkElem, parts[2]);
linkElem.textContent = parts[1];
linkElem.target = "_blank";
@ -524,6 +525,7 @@ class MarkDown {
}
}
}
}
current.textContent += txt[i];
}
appendcurrent();

View file

@ -503,11 +503,13 @@ class MarkDown{
if(partsFound === 2){
appendcurrent();
i=j;
const parts=build.join("").match(/^\[(.+)\]\((https?:.+?)( ('|").+('|"))?\)$/);
if(parts){
const linkElem=document.createElement("a");
if(URL.canParse(parts[2])){
i=j;
MarkDown.safeLink(linkElem,parts[2])
linkElem.textContent=parts[1];
linkElem.target="_blank";
@ -519,6 +521,7 @@ class MarkDown{
}
}
}
}
current.textContent+=txt[i];
}