<p dir="auto">We have the following code:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="require('web-frame').setSpellCheckProvider(&quot;en-US&quot;, false, {
  spellCheck: function (word) {
    // the spell checking mechanism
  }
});"><pre class="notranslate"><span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'web-frame'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">setSpellCheckProvider</span><span class="pl-kos">(</span><span class="pl-s">"en-US"</span><span class="pl-kos">,</span> <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-kos">{</span>
  <span class="pl-en">spellCheck</span>: <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-s1">word</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-c">// the spell checking mechanism</span>
  <span class="pl-kos">}</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<ul dir="auto">
<li><code class="notranslate">isn't</code> gets wrong highlighting when:
<ul dir="auto">
<li>spellCheck have been called with <code class="notranslate">isn</code> and we return <code class="notranslate">false</code></li>
<li>spellCheck have been called with <code class="notranslate">isn't</code> and we return <code class="notranslate">true</code></li>
</ul>
</li>
</ul>
<p dir="auto">The only way to get correct highlighting for <code class="notranslate">isn't</code> is to return true in both cases. However, <code class="notranslate">isn</code> is not a correct word so this is somewhat hacky. The same applies for <code class="notranslate">doesn't</code>, 'aren't<code class="notranslate">, 'didn't</code>, 'wasn't`, etc...</p>
<p dir="auto">With the current implementation it is also not possible to make an URL or email address valid because the <code class="notranslate">spellCheck</code> callback is called individually for <code class="notranslate">http</code>, <code class="notranslate">the-website</code> and <code class="notranslate">com</code>.</p>
<hr>
<p dir="auto">Solutions for these problems would be to call <code class="notranslate">spellCheck</code> callback only when a <code class="notranslate">Space</code> have been entered.</p>
<p dir="auto">We're using the <code class="notranslate">spellchecker</code> module within the <code class="notranslate">preload</code> script of a renderer process, and have followed the basic steps for setting it up as the provider via <a href="https://github.com/atom/atom-shell/blob/master/docs/api/web-frame.md"><code class="notranslate">web-frame</code></a>.</p>
<p dir="auto">However, it seems to break words at the apostrophe mark rather than process the complete contraction. I'm not sure if this is an issue with the dictionary or the affix file, but the result is undesirable:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/a97fed41a5f58749fbe92b5506981a08281d4c011bfbe825a37fb938ee1482fa/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f662e636c2e6c792f6974656d732f335a3067326232623232314b325230413431327a2f496d616765253230323031352d30312d31332532306174253230332e30312e3036253230504d2e706e67"><img src="https://camo.githubusercontent.com/a97fed41a5f58749fbe92b5506981a08281d4c011bfbe825a37fb938ee1482fa/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f662e636c2e6c792f6974656d732f335a3067326232623232314b325230413431327a2f496d616765253230323031352d30312d31332532306174253230332e30312e3036253230504d2e706e67" alt="" data-canonical-src="https://s3.amazonaws.com/f.cl.ly/items/3Z0g2b2b221K2R0A412z/Image%202015-01-13%20at%203.01.06%20PM.png" style="max-width: 100%;"></a></p>
<p dir="auto">Any ideas on what's happening?</p>