Skip to content
This repository was archived by the owner on Apr 22, 2020. It is now read-only.

Commit c059069

Browse files
Fixed issue84: html to text unescaping was borken around  
1 parent 5fec3de commit c059069

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/prettify.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,8 @@ window['_pr_isIE6'] = function () {
264264
.replace(pr_gtEnt, '>')
265265
.replace(pr_aposEnt, "'")
266266
.replace(pr_quotEnt, '"')
267-
.replace(pr_ampEnt, '&')
268-
.replace(pr_nbspEnt, ' ');
267+
.replace(pr_nbspEnt, ' ')
268+
.replace(pr_ampEnt, '&');
269269
}
270270

271271
/** is the given node's innerHTML normally unescaped? */

tests/prettify_test.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,6 +1013,9 @@ <h1>CSS w/ language specified</h1>
10131013
--&gt;
10141014
</pre>
10151015

1016+
<h1>Issue 84 NBSPs</h1>
1017+
<pre class="prettyprint lang-java" id="issue84">super("&amp;nbsp;");</pre>
1018+
10161019
<h1>Issue 86</h1>
10171020
<p><code class="prettyprint" id="issue86_0">#One
10181021
Two words</code></p>
@@ -2390,6 +2393,7 @@ <h1>Issue 86</h1>
23902393
'`KWDfont-weight`END`PUN:`END`PLN bolder `END`PUN}`END`PLN<br>' +
23912394
'`END`COM--&gt;`END'
23922395
),
2396+
issue84: '`KWDsuper`END`PUN(`END`STR"&amp;nbsp;"`END`PUN);`END',
23932397
issue86_0: '`COM#One Two words`END',
23942398
issue86_1: '`COM#One`END`PLN<br>' +
23952399
'`END`TYPTwo`END`PLN lines`END',

0 commit comments

Comments
 (0)