mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-21 09:38:01 +02:00
10 lines
332 B
JavaScript
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);
|
||
|
};
|