import baseMessageModifierPlugin from "./baseMessageModifierPlugin" ; export default class MarkdownLinks extends baseMessageModifierPlugin { protected doChange ( t ) { return t . replace ( /\[([^\]]+)\]\(([^\)]+)\)/g , ( _ , text , url ) => `<${ url }|${ text }>` ) ; } protected undoChange ( t ) { return t . replace ( /<(?!!)([^<>\|]+)\|([^<>]+)>/g , ( _ , url , title ) => `[${ title }](${ url })` ) ; } }