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 61ce0471a4
commit c028e1969c
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 */ /* but also has a new function that can return the HTML that corresponds */
/* to the string. */ /* to the string. */
function mfHTML(value) { function mfHTML(value) {
this.valueOf = function() {return value.valueOf();} this.valueOf = function() {return value ? value.valueOf() : "";}
this.toString = function() {return value.toString();} this.toString = function() {return value ? value.toString() : "";}
} }
mfHTML.prototype = new String; mfHTML.prototype = new String;
mfHTML.prototype.toHTML = function() { mfHTML.prototype.toHTML = function() {

View File

@ -174,6 +174,11 @@
</div> </div>
</div> </div>
<div class="vevent" id="empty-description">
<span class="description"></span>
</div>
</div> </div>
<pre id="test"> <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("18-component-vevent-uid.5"));
hcalendar = new hCalendar(document.getElementById("19-calendar-attachments")); hcalendar = new hCalendar(document.getElementById("19-calendar-attachments"));
hcalendar = new hCalendar(document.getElementById("empty-description"));
is (hcalendar.description, "", "Empty description");
} }
</script> </script>