I m using the jquery spellchecker plugin on a contenteditable div, which inserts divs and brs on return. The spellchecker s regex won t match an incorrectly spelled word which is next to a tag. Here is the contents of div i m performing the regex on:
Praesent commodo cursus magna,
<br>
<br>
dsf
<br>
vel scelerisque nisl consectetur et.
这里是一片 lo,取而代之。 措辞不正确:
var re = new RegExp( (^|[^a-zA-Z])( + replaceWord + )([^a-zA-Z]|$) , g );
html = html.replace(re, $1<span class="spellcheck-word-highlight">$2</span>$3 );
The regex correctly matches all other words though. Any thoughts?
感谢!