html-textview icon indicating copy to clipboard operation
html-textview copied to clipboard

IndexOutOfBoundsException: setSpan (411 ... 419) ends beyond length 411

Open darvid7 opened this issue 7 years ago • 3 comments

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(&quot;@std/esm&quot;)</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
&gt; require(&quot;@std/esm&quot;)
{}
&gt; import { strictEqual } from &quot;assert&quot;
&gt; 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!

darvid7 avatar May 30 '17 22:05 darvid7

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.

dschuermann avatar May 31 '17 21:05 dschuermann

bro did you fix it I'm getting same problem

MustafaAndroid avatar Jun 27 '19 12:06 MustafaAndroid

遇到同样的问题

HUANONE avatar Dec 12 '19 03:12 HUANONE