@atlaskit/adf-schema
Version:
Shared package that contains the ADF-schema (json) and ProseMirror node/mark specs
22 lines (20 loc) • 744 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.normalizeUrl = normalizeUrl;
var _getLinkMatch = require("./get-link-match");
/**
* 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
*/
/**
* Adds protocol to url if needed.
* Returns empty string if no url given or if no link match found.
*/
function normalizeUrl(url) {
var match = (0, _getLinkMatch.getLinkMatch)(url);
return match && match.url || '';
}