import { pagePathUtils } from '@growi/core'; const { encodeSpaces } = pagePathUtils; export default class Linker { constructor( type = Linker.types.markdownLink, label = '', link = '', ) { this.type = type; this.label = label; this.link = link; if (type === Linker.types.markdownLink) { this.initWhenMarkdownLink(); } this.generateMarkdownText = this.generateMarkdownText.bind(this); } static types = { markdownLink: 'mdLink', growiLink: 'growiLink', pukiwikiLink: 'pukiwikiLink', } static patterns = { pukiwikiLinkWithLabel: /^\[\[(?