From 847a3731f9ef26e09245af72dbceb726463c6c7e Mon Sep 17 00:00:00 2001 From: Nulo Date: Thu, 20 Apr 2023 09:08:11 -0300 Subject: [PATCH] pegar links internos correctamente --- src/editor/schema.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/editor/schema.ts b/src/editor/schema.ts index 5c137dc..003b91a 100644 --- a/src/editor/schema.ts +++ b/src/editor/schema.ts @@ -307,15 +307,19 @@ export const schema = new Schema({ parseDOM: [ { tag: "a[href]", + priority: 100, // TODO: untested getAttrs(dom) { dom = dom as HTMLElement; const href = dom.getAttribute("href"); - if (href?.startsWith("/w/")) { - const matches = parse(routes.Page).pattern.exec(href); - if (!matches) return false; + if ( + href && + /[useandom\-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict]{21}/.test( + href + ) + ) { return { - id: matches[1], + id: href, }; } else return false; },