pegar links internos correctamente
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
7c8d36e7c3
commit
847a3731f9
1 changed files with 8 additions and 4 deletions
|
@ -307,15 +307,19 @@ export const schema = new Schema({
|
||||||
parseDOM: [
|
parseDOM: [
|
||||||
{
|
{
|
||||||
tag: "a[href]",
|
tag: "a[href]",
|
||||||
|
priority: 100,
|
||||||
// TODO: untested
|
// TODO: untested
|
||||||
getAttrs(dom) {
|
getAttrs(dom) {
|
||||||
dom = dom as HTMLElement;
|
dom = dom as HTMLElement;
|
||||||
const href = dom.getAttribute("href");
|
const href = dom.getAttribute("href");
|
||||||
if (href?.startsWith("/w/")) {
|
if (
|
||||||
const matches = parse(routes.Page).pattern.exec(href);
|
href &&
|
||||||
if (!matches) return false;
|
/[useandom\-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict]{21}/.test(
|
||||||
|
href
|
||||||
|
)
|
||||||
|
) {
|
||||||
return {
|
return {
|
||||||
id: matches[1],
|
id: href,
|
||||||
};
|
};
|
||||||
} else return false;
|
} else return false;
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue