Bug #433759 - Microformats - handle empty hCalendar description

r=sayre
This commit is contained in:
Michael Kaply 2008-09-14 18:58:05 -05:00
parent c655c9d010
commit 54e348143c
2 changed files with 10 additions and 2 deletions

View File

@ -494,8 +494,8 @@ var Microformats = {
/* but also has a new function that can return the HTML that corresponds */
/* to the string. */
function mfHTML(value) {
this.valueOf = function() {return value.valueOf();}
this.toString = function() {return value.toString();}
this.valueOf = function() {return value ? value.valueOf() : "";}
this.toString = function() {return value ? value.toString() : "";}
}
mfHTML.prototype = new String;
mfHTML.prototype.toHTML = function() {

View File

@ -174,6 +174,11 @@
</div>
</div>
<div class="vevent" id="empty-description">
<span class="description"></span>
</div>
</div>
<pre id="test">
@ -295,6 +300,9 @@ function test_hCard() {
hcalendar = new hCalendar(document.getElementById("18-component-vevent-uid.5"));
hcalendar = new hCalendar(document.getElementById("19-calendar-attachments"));
hcalendar = new hCalendar(document.getElementById("empty-description"));
is (hcalendar.description, "", "Empty description");
}
</script>