mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-06-28 16:23:15 +00:00
Don't throw errors when hitting limits of the fakedom
This commit is contained in:
parent
1733a2c39c
commit
432542bbcc
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user