mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-27 03:57:21 +00:00
Added support for hexadecimal HTML entities
This commit is contained in:
parent
ef60c9018e
commit
a09c43d456
@ -69,8 +69,12 @@ utils.htmlDecode = function(s)
|
||||
// Converts all HTML entities to their character equivalents
|
||||
utils.entityDecode = function(s) {
|
||||
var e = s.substr(1,s.length-2); // Strip the & and the ;
|
||||
if(e.charAt(0) == "#") {
|
||||
return String.fromCharCode(parseInt(e.substr(1),10));
|
||||
if(e.charAt(0) === "#") {
|
||||
if(e.charAt(1) === "x" || e.charAt(1) === "X") {
|
||||
return String.fromCharCode(parseInt(e.substr(2),16));
|
||||
} else {
|
||||
return String.fromCharCode(parseInt(e.substr(1),10));
|
||||
}
|
||||
} else {
|
||||
var c = utils.htmlEntities[e];
|
||||
if(c) {
|
||||
|
@ -1 +1 @@
|
||||
An image <img src="Something.jpg" /> and a couple of Ç "HTML Entity"
|
||||
An image <img src="Something.jpg" /> and a couple of Ç Ç "HTML Entity"
|
@ -1,3 +1,3 @@
|
||||
title: Fourth Tiddler
|
||||
|
||||
An image [img[Something.jpg]] and a couple of Ç "HTML Entity"
|
||||
An image [img[Something.jpg]] and a couple of Ç Ç "HTML Entity"
|
@ -1 +1 @@
|
||||
An image and a couple of Ç "HTML Entity"
|
||||
An image and a couple of Ç Ç "HTML Entity"
|
Loading…
Reference in New Issue
Block a user