1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-25 23:03:15 +00:00

Don't throw errors when hitting limits of the fakedom

This commit is contained in:
Jermolene 2017-06-05 16:12:43 +01:00
parent 1733a2c39c
commit 432542bbcc

View File

@ -224,8 +224,7 @@ Object.defineProperty(TW_Element.prototype, "textContent", {
get: function() { get: function() {
if(this.isRaw) { if(this.isRaw) {
if(this.rawTextContent === null) { if(this.rawTextContent === null) {
console.log(booboo) return "";
throw "Cannot get textContent on a raw TW_Element";
} else { } else {
return this.rawTextContent; return this.rawTextContent;
} }
@ -245,7 +244,7 @@ Object.defineProperty(TW_Element.prototype, "textContent", {
Object.defineProperty(TW_Element.prototype, "formattedTextContent", { Object.defineProperty(TW_Element.prototype, "formattedTextContent", {
get: function() { get: function() {
if(this.isRaw) { if(this.isRaw) {
throw "Cannot get formattedTextContent on a raw TW_Element"; return "";
} else { } else {
var b = [], var b = [],
isBlock = $tw.config.htmlBlockElements.indexOf(this.tag) !== -1; isBlock = $tw.config.htmlBlockElements.indexOf(this.tag) !== -1;