@atlaskit/editor-wikimarkup-transformer
Version:
Wiki markup transformer for JIRA and Confluence
36 lines (35 loc) • 1.07 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.issueLinkResolver = issueLinkResolver;
var _issueKey = require("../issue-key");
function issueLinkResolver(link, schema, context) {
var originalLinkText = link.originalLinkText,
linkTitle = link.linkTitle,
notLinkBody = link.notLinkBody;
if (linkTitle === 'smart-card' ||
// Ignored via go/ees007
// eslint-disable-next-line @atlaskit/editor/enforce-todo-comment-format
// TODO: Depricated should be removed in the next major release
linkTitle === 'block-link') {
return [schema.nodes.blockCard.createChecked({
url: notLinkBody
})];
}
if (linkTitle === 'smart-link') {
return [schema.nodes.inlineCard.createChecked({
url: notLinkBody
})];
}
if (linkTitle === 'smart-embed') {
return [schema.nodes.embedCard.createChecked({
url: notLinkBody
})];
}
var issue = (0, _issueKey.getIssue)(context, originalLinkText);
if (issue) {
return (0, _issueKey.buildInlineCard)(schema, issue);
}
return undefined;
}