Commit Graph

14 Commits

Author SHA1 Message Date
Emily Stark
ba0770a908 Merge remote-tracking branch 'origin/devel' into blaze-refactor
Conflicts:
	packages/html-tools/tokenize.js
	packages/spacebars-compiler/package.js
	packages/spacebars-compiler/spacebars-compiler.js
	packages/spacebars-tests/template_tests.html
	packages/spacebars-tests/template_tests.js
	packages/spacebars/package.js
	packages/spacebars/spacebars-runtime.js
	packages/ui/domrange.js
	packages/ui/render_tests.js
2014-06-06 14:05:44 -07:00
Matthew Arbesfeld
f90e09fbe5 Fix for #2175 - Spacebars block comment cause unexpected errors
This fixes an edge case where a comment is followed immediately
by an {{else}} token.
2014-05-27 03:36:50 -04:00
David Greenspan
a2552be8f8 HTMLTools: Kill "Special" as a TemplateTag wrapper
Remove the concept of a "Special" as a generalization of template tags in HTML parsing and the HTMLjs tree.  Just call something that's parsed by hooking the HTML parser a TemplateTag.  Don't wrap the return value of getSpecialTag (now getTemplateTag), just require that it be an instanceof HTMLTools.TemplateTag.

Spacebars.TemplateTag is now a subclass of HTMLTools.TemplateTag.  Both support `.toJS()`.  The same object returned by getTemplateTag is now inserted into the HTMLjs -- that is, the Spacebars compiler creates an HTMLTools.TemplateTag instead of it being created as a wrapper inside HTMLTools.  All usages of the words "special" or "special tag" are replaced with "template tag."
2014-04-24 10:18:02 -07:00
David Greenspan
54ce3ce4b3 Combine getQuoted- and getUnquotedAttributeValue 2014-04-24 08:46:31 -07:00
David Greenspan
43d672bd6a Use refactored html.js in "old" ui-package Blaze
Some failing tests, which are hopefully mostly just tests of the modified code that need to be ported.

The main work was replacing the use of pseudo-attributes $special and $dynamic with the new HTML.Attrs(...) / array representation.  Some functions were also rewritten to use Visitors (`toJS`, old `toHTML`/`toText`/`evaluateAttributes`, `replaceSpecials` in the compiler, but not `optimize` yet or `materialize`).

Create the "blaze-tools" package to hold toJS and other functions that are useful for template parsers/compilers that need to read or generate JS.
2014-04-22 13:47:57 -07:00
David Greenspan
57f11cb961 Use HTMLTools namespace for all of html-tools 2014-03-03 15:51:35 -08:00
David Greenspan
5e85c32ea6 Move asciiLowerCase to html-tools 2014-03-03 15:51:35 -08:00
David Greenspan
f6c766ae06 Start html.js refactor; case-fold at compile time
- Start shrinking html.js down to the 150-line file it can be
- Move "proper case" logic to the template compiler; the tagName of an HTMLjs tag is now in proper case.  This is both for better performance and reduced size and complexity of runtime code (i.e. blaze.js).
- Start moving html-tools to the HTMLTools namespace
2014-03-03 15:51:35 -08:00
David Greenspan
7be0250867 Fix CRLF handling in HTML tokenizer
We would choke on CR line endings, because we didn't implement the preprocessing step of converting CR(LF)? to LF.  Now we correctly convert (or ignore) CR inside tags, in text nodes, in attributes, and in comments.
2014-01-20 19:19:07 -08:00
David Greenspan
56e94821e3 Spacebars: better errors, comment handling
Give better errors (and in some cases, errors at all) for cases like:
- `<a {{{x}}}>`
- `<a {{#if x}}foo{{/if}}>`
- `<a {{k}}={{v}}>`
- `<a x{{y}}=z>`

Also, allow comments (`{{! x}}`) anywhere a non-comment tag is allowed
2014-01-13 13:04:27 -08:00
David Greenspan
30a4b2b7d4 Fix bug in parsing of HTML attributes
e.g. <foo bar baz>.  (D'oh.)
2013-12-18 12:09:35 -08:00
David Greenspan
7dab61e50a Fix infinite loop 2013-12-11 23:03:09 -08:00
David Greenspan
7fadc29828 Start to make markdown work; avoid double UI.body 2013-12-11 22:32:48 -08:00
David Greenspan
b20119775f rename package "html" -> "html-tools" 2013-12-11 20:14:26 -08:00