updated links in MD
This commit is contained in:
parent
04779b6c6c
commit
ecbf78b0ff
2 changed files with 21 additions and 16 deletions
|
@ -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();
|
||||
|
|
|
@ -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];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue