1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-27 10:32:58 +02:00
joplin/packages/app-mobile/MarkdownEditor/utils.js
2020-11-05 16:58:23 +00:00

10 lines
332 B
JavaScript

import regexValidator from './webLinkValidator';
export const replaceBetween = (text: string, selection: Object, what: string) =>
text.substring(0, selection.start) + what + text.substring(selection.end);
export const isStringWebLink = (text: string): boolean => {
const pattern = regexValidator;
return pattern.test(text);
};