luckasRanarison / nvim-devdocs

Neovim DevDocs integration
MIT License
269 stars 19 forks source link

Svelte script tags #56

Closed luckasRanarison closed 1 year ago

luckasRanarison commented 1 year ago

The linebreak doesn't work. The current <pre> tag children evaluation is done by checking the next child neighbor and check if there should be additional spaces or characters between them, but it doesn't work in the following case because the tags are direct neighbor but have nested children.

    <script>import { getAllContexts } from 'svelte';                                           

        const contexts = getAllContexts();                                                         
    </script>                                                                                  
<pre class="language-svelte"><code><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>script</span><span class="token punctuation">&gt;</span></span><span class="token script"><span class="token language-javascript">
    <span class="token keyword">import</span> <span class="token punctuation">{</span> getAllContexts <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'svelte'</span><span class="token punctuation">;</span>

    <span class="token keyword">const</span> contexts <span class="token operator">=</span> <span class="token function">getAllContexts</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>script</span><span class="token punctuation">&gt;</span></span></code><button type="button" class="_pre-clip" title="Copy to clipboard" aria-label="Copy to clipboard"><svg><use xlink:href="#icon-copy"></use></svg></button></pre>