on master help sign in
schema: fix href check
7a5e35bMatilde Park
components/schema/link.markdoc.js+4−6
@@ -3,12 +3,10 @@ import { Tag } from "@markdoc/markdoc";
3function checkIfExternal(attributes) {
3function checkIfExternal(attributes) {
4 const href = attributes.href;
4 const href = attributes.href;
5 if (
5 if (
6− href.includes(
7− "https://urbit.org" ||
6+ href.includes("https://urbit.org") ||
8− href.startsWith("/") ||
7+ href.startsWith("/") ||
9− href.startsWith("#") ||
8+ href.startsWith("#") ||
10− href.startsWith("?")
9+ href.startsWith("?")
11− )
12 ) {
10 ) {
13 return "_self";
11 return "_self";
14 } else {
12 } else {