UNPKG

@atlaskit/adf-schema

Version:

Shared package that contains the ADF-schema (json) and ProseMirror node/mark specs

21 lines (19 loc) 766 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isRootRelative = isRootRelative; /** * This file has been partially duplicated in packages/linking-platform/linking-common/src/url.ts * Any changes made here should be mirrored there. * Ticket for dedeplication: https://product-fabric.atlassian.net/browse/EDM-7138 * Ticket for fixing linkification of filename-like urls: https://product-fabric.atlassian.net/browse/EDM-7190 */ /** * checks if root relative link */ function isRootRelative(url) { // Support `#top` and `#` special references as per: // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#linking_to_an_element_on_the_same_page return url.startsWith('/') || url === '#top' || url === '#'; }