html5/md Overview.html,1.19,1.20

Update of /sources/public/html5/md
In directory hutz:/tmp/cvs-serv19457

Modified Files:
	Overview.html 
Log Message:
Fix some coding errors in a scripted iCalendar example. (whatwg r4605)

Index: Overview.html
===================================================================
RCS file: /sources/public/html5/md/Overview.html,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- Overview.html	18 Jan 2010 06:36:29 -0000	1.19
+++ Overview.html	18 Jan 2010 06:46:27 -0000	1.20
@@ -3793,7 +3793,9 @@
    this:</p>
 
    <pre>function getCalendar(node) {
-  while (node &amp;&amp; (!node.nodeScope || !node.itemType == 'http://microformats.org/profile/hcalendar#vevent'))
+  // This function assumes the content is valid.
+  // It is not a compliant implementation of the algorithm for <a href="#extracting-vevent-data">extracting vEvent data</a>.
+  while (node &amp;&amp; (!node.itemScope || !node.itemType == 'http://microformats.org/profile/hcalendar#vevent'))
     node = node.parentNode;
   if (!node) {
     alert('No event data found.');
@@ -3811,19 +3813,19 @@
     var parameters = '';
     if (prop.localName == 'time') {
       value = value.replace(/[:-]/g, '');
-      if (prop.date &amp;&amp; prop.time)
+      if (value.match(/T/))
         parameters = ';VALUE=DATE';
       else
         parameters = ';VALUE=DATE-TIME';
     } else {
       value = value.replace(/\\/g, '\\n');
       value = value.replace(/;/g, '\\;');
-      value = value.replace(/,/g, \\,');
+      value = value.replace(/,/g, '\\,');
       value = value.replace(/\n/g, '\\n');
     }
     for (var nameIndex = 0; nameIndex &lt; prop.itemProp.length; nameIndex += 1) {
       var name = prop.itemProp[nameIndex];
-      if (!name.match(':') &amp;&amp; !name.match('.'))
+      if (!name.match(/:/) &amp;&amp; !name.match(/\./))
         calendar += name.toUpperCase() + parameters + ':' + value + '\r\n';
     }
   }

Received on Monday, 18 January 2010 06:46:31 UTC