Skip to content
Snippets Groups Projects
Commit 4a797620 authored by Phil Hughes's avatar Phil Hughes
Browse files

Added comments to regex

parent eb993dc5
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -91,6 +91,7 @@
inputValue = inputValue.replace(/"(.*?)"/g, str => str.replace(/\s/g, '_') );
 
// Get the right position for the word selected
// Regex matches first space
let right = inputValue.slice(selectionStart).search(/\s/);
 
if (right >= 0) {
Loading
Loading
@@ -100,6 +101,7 @@
}
 
// Get the left position for the word selected
// Regex matches last non-whitespace character
let left = inputValue.slice(0, right).search(/\S+$/);
 
if (selectionStart === 0) {
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment