Describe the bug
When a linkProtocol is specified in options, it seems to search the url using regex to determine if the url's protocol matches the linkProtocol option. However the url is not escaped, resulting in a SyntaxError if any regex special characters are present in the link.
To Reproduce
Steps to reproduce the behavior:
Go to http://suneditor.com/sample/html/options.html
Enable linkProtocol and set to anything e.g. https://
Select 'Create' to generate the editor
Open add link dialogue
Type a regex special character such as '[' in the URL to link input
Describe the bug When a linkProtocol is specified in options, it seems to search the url using regex to determine if the url's protocol matches the linkProtocol option. However the url is not escaped, resulting in a SyntaxError if any regex special characters are present in the link.
To Reproduce Steps to reproduce the behavior:
Go to http://suneditor.com/sample/html/options.html Enable linkProtocol and set to anything e.g. https:// Select 'Create' to generate the editor Open add link dialogue Type a regex special character such as '[' in the URL to link input
Screenshots![image](https://github.com/JiHong88/suneditor/assets/23160768/f64410ca-93aa-499c-8bbf-d8c90ba0b418)
Desktop OS: macOS 13.5 Browser: Chrome Version: 118.0.5993.117 (Official Build) (x86_64)