html-textview
html-textview copied to clipboard
IndexOutOfBoundsException: setSpan (411 ... 419) ends beyond length 411
Hi, I'm trying to render this HTML
<h1 id="stdesm">@std/esm</h1>
<h2 id="usage">Usage</h2>
<ol><li>Run <code>npm i --save @std/esm</code> in your package or app directory.</li><li>Call <code>require("@std/esm")</code> before importing ECMAScript modules.</li>
</ol>
<p>Enable ESM in the Node REPL by loading <code>@std/esm</code> upon entering:</p>
<pre><code class="language-shell">$ node
> require("@std/esm")
{}
> import { strictEqual } from "assert"
> strictEqual(2 + 2, 5)
AssertionError: 4 === 5
at repl:1:1
at REPLServer.defaultEval (repl.js:272:27)
...
</code></pre>
<h2 id="features">Features</h2>
<table>
<tr><th></td><th><code>@std/esm</code></td><th>ESM in Node 10</th></tr>
<tr><td><a href="https://github.com/tc39/proposal-dynamic-import">Dynamic <code>import()</code></a></td><td>✅</td><td>✅</td></tr>
<tr><td><a href="https://ponyfoo.com/articles/es6-modules-in-depth#bindings-not-values">Live bindings</a></td><td>✅</td><td>✅</td></tr>
<tr><td>Loads <code>.mjs</code> as ESM</td><td>✅</td><td>✅</td></tr>
<tr><td>Loads <code>.js</code> as ESM</td><td>✅</td><td>❌</td></tr>
<tr><td>Loads gzipped modules <i>(e.g. <code>.js.gz</code>, <code>.mjs.gz</code>)</i></td><td>✅</td><td>❌</td></tr>
<tr><td>Node 4+ support</td><td>✅</td><td>❌</td></tr>
<tr><td>Top-level <code>await</code> for main ES module</td><td>✅ *</td><td>❌</td></tr>
<tr><td>Unordered specifiers <code>import * as ns, v, {a,b} from "mod"</code></td><td>✅ *</td><td>❌</td></tr>
<tr><td><a href="https://ponyfoo.com/articles/es6-modules-in-depth#importing-named-exports"><code>import {a,b} from "cjs"</code></a></td><td>✅ *</td><td>❌</td></tr>
<tr><td><a href="https://github.com/leebyron/ecmascript-export-ns-from"><code>export * as ns from "mod"</code></a></td><td>✅ *</td><td>❌</td></tr>
<tr><td><a href="https://github.com/leebyron/ecmascript-export-default-from"><code>export v from "mod"</code></a></td><td>✅ *</td><td>❌</td></tr>
<tr><td><a href="http://stackoverflow.com/questions/28955047/why-does-a-module-level-return-statement-work-in-node-js/#28955050">Top-level <code>return</code></a> in ESM</td><td>✅ **</td><td>❌</td></tr>
<tr><td><code>__dirname</code> in ESM</td><td>✅ **</td><td>❌</td></tr>
<tr><td><code>__filename</code> in ESM</td><td>✅ **</td><td>❌</td></tr>
<tr><td><code>require</code> in ESM</td><td>✅ **</td><td>❌</td></tr>
<tr><td>Loads ESM with <code>require</code> from CJS</td><td>✅ **</td><td>❌</td></tr>
</table>
<p>
<i>* ESM expansions</i><br>
<i>** Carryover from CJS</i>
</p>
And I'm getting the error IndexOutOfBoundsException: setSpan (411 ... 419) ends beyond length 411
in mMarkdownHtmlTextView.setHtml(html, new HtmlHttpImageGetter(mMarkdownHtmlTextView));
Any ideas what could be going wrong? Thanks!
That's a lot of complicated HTML there. HtmlTextView supports only a very small subset of HTML. Try to find the part in your HTML that crashes it, currently this does not help in debugging.
bro did you fix it I'm getting same problem
遇到同样的问题