updated links in MD
This commit is contained in:
@@ -510,10 +510,11 @@ class MarkDown {
|
|||||||
}
|
}
|
||||||
if (partsFound === 2) {
|
if (partsFound === 2) {
|
||||||
appendcurrent();
|
appendcurrent();
|
||||||
i = j;
|
|
||||||
const parts = build.join("").match(/^\[(.+)\]\((https?:.+?)( ('|").+('|"))?\)$/);
|
const parts = build.join("").match(/^\[(.+)\]\((https?:.+?)( ('|").+('|"))?\)$/);
|
||||||
if (parts) {
|
if (parts) {
|
||||||
const linkElem = document.createElement("a");
|
const linkElem = document.createElement("a");
|
||||||
|
if (URL.canParse(parts[2])) {
|
||||||
|
i = j;
|
||||||
MarkDown.safeLink(linkElem, parts[2]);
|
MarkDown.safeLink(linkElem, parts[2]);
|
||||||
linkElem.textContent = parts[1];
|
linkElem.textContent = parts[1];
|
||||||
linkElem.target = "_blank";
|
linkElem.target = "_blank";
|
||||||
@@ -524,6 +525,7 @@ class MarkDown {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
current.textContent += txt[i];
|
current.textContent += txt[i];
|
||||||
}
|
}
|
||||||
appendcurrent();
|
appendcurrent();
|
||||||
|
@@ -503,11 +503,13 @@ class MarkDown{
|
|||||||
|
|
||||||
if(partsFound === 2){
|
if(partsFound === 2){
|
||||||
appendcurrent();
|
appendcurrent();
|
||||||
i=j;
|
|
||||||
|
|
||||||
const parts=build.join("").match(/^\[(.+)\]\((https?:.+?)( ('|").+('|"))?\)$/);
|
const parts=build.join("").match(/^\[(.+)\]\((https?:.+?)( ('|").+('|"))?\)$/);
|
||||||
if(parts){
|
if(parts){
|
||||||
const linkElem=document.createElement("a");
|
const linkElem=document.createElement("a");
|
||||||
|
if(URL.canParse(parts[2])){
|
||||||
|
i=j;
|
||||||
MarkDown.safeLink(linkElem,parts[2])
|
MarkDown.safeLink(linkElem,parts[2])
|
||||||
linkElem.textContent=parts[1];
|
linkElem.textContent=parts[1];
|
||||||
linkElem.target="_blank";
|
linkElem.target="_blank";
|
||||||
@@ -519,6 +521,7 @@ class MarkDown{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
current.textContent+=txt[i];
|
current.textContent+=txt[i];
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user