You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was wondering why you opted to use the regex to count spaces? It's restricting in the sense that it neither accounts for double spaces after a period (habit of mine) nor does it account for line breaks in the files containing html.
When I figured out the problem, I replaced the regex logic with:
var beforeLastSpace = str.substring(0, str.lastIndexOf(' '));
var afterLastSpace = str.substring(str.lastIndexOf(' ') + 1, str.length);
var res = beforeLastSpace + ' ' + afterLastSpace;
and it works fine for my case. I would send a pull request - but I figured I'd ask about it first because you may have very good reasons.
Thanks much for your plugin
The text was updated successfully, but these errors were encountered:
I was wondering why you opted to use the regex to count spaces? It's restricting in the sense that it neither accounts for double spaces after a period (habit of mine) nor does it account for line breaks in the files containing html.
When I figured out the problem, I replaced the regex logic with:
and it works fine for my case. I would send a pull request - but I figured I'd ask about it first because you may have very good reasons.
Thanks much for your plugin
The text was updated successfully, but these errors were encountered: