/[suikacvs]/markup/html/scripting-parser/parser.html
Suika

Diff of /markup/html/scripting-parser/parser.html

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.8 by wakaba, Sun Apr 27 08:56:34 2008 UTC revision 1.9 by wakaba, Sun Apr 27 09:16:11 2008 UTC
# Line 150  Line 150 
150          tagName = v.toLowerCase ();          tagName = v.toLowerCase ();
151          return '';          return '';
152        });        });
153        e = e.replace (/^\s*([^\s=]+)\s*(?:=\s*(?:"([^"]*)"|'([^']*)'|([^"']+)))?/,        while (true) {
154        function (x, attrName, attrValue1, attrValue2, attrValue3) {          var m = false;
155          v = attrValue1 || attrValue2 || attrValue3;          e = e.replace (/^\s*([^\s=]+)\s*(?:=\s*(?:"([^"]*)"|'([^']*)'|([^"'\s]*)))?/,
156          v = v.replace (/"/g, '"').replace (/'/g, "'")          function (x, attrName, attrValue1, attrValue2, attrValue3) {
157              .replace (/&/g, '&');            v = attrValue1 || attrValue2 || attrValue3;
158          attrs[attrName.toLowerCase ()] = v;            v = v.replace (/"/g, '"').replace (/'/g, "'")
159          return '';                .replace (/&/g, '&');
160        });            attrs[attrName.toLowerCase ()] = v;
161              m = true;
162              return '';
163            });
164            if (!m) break;
165          }
166        if (e.length) {        if (e.length) {
167          log ('Broken start tag: "' + e + '"');          log ('Broken start tag: "' + e + '"');
168        }        }
# Line 644  Line 649 
649          r += '| ' + indent + node.localName + '\n';          r += '| ' + indent + node.localName + '\n';
650          if (node.async) r += '| ' + indent + '  async=""\n';          if (node.async) r += '| ' + indent + '  async=""\n';
651          if (node.defer) r += '| ' + indent + '  defer=""\n';          if (node.defer) r += '| ' + indent + '  defer=""\n';
652          if (node.src) r += '| ' + indent + '  src="' + node.src + '"\n';          if (node.src != null) {
653              r += '| ' + indent + '  src="' + node.src + '"\n';
654            }
655          r += dumpTree (node, indent + '  ');          r += dumpTree (node, indent + '  ');
656        } else if (node instanceof JSText) {        } else if (node instanceof JSText) {
657          r += '| ' + indent + '"' + node.data + '"\n';          r += '| ' + indent + '"' + node.data + '"\n';
# Line 732  the regular expression <code>^javascript Line 739  the regular expression <code>^javascript
739  <p>For some reason, this parser does not work in browsers that do  <p>For some reason, this parser does not work in browsers that do
740  not support JavaScript 1.5.  not support JavaScript 1.5.
741    
 <!-- TODO: multiple attributes are not supported yet -->  
   
742  </body>  </body>
743  </html>  </html>

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24