Class | Iowa::TemplateParser |
In: |
src/TemplateParser.rb
|
Parent: | Object |
Parse a template for dynamic elements.
Bodyless | = | %w(p input li hr option) | ||
OID | = | "oid" | ||
PatternString | = | "(<\\s*([^>]+?)\\s+([^>]*?" + OID + "\\s*=('|\")\\s*(.*?)\\s*(\\4)[^>]*?(/)?\\s*)>)" + "|" + "(@([\\w.]+))" | ||
Pattern | = | Regexp.new(PatternString) | Regexp constant that defines the regexp to use to parse the template for dynamic content tags. | |
DynamicTag | = | 1 | Constant that defines the position in Pattern of the dynamic tag data. | |
Tag | = | 2 | ||
Attributes | = | 3 | ||
ID | = | 5 | ||
Close | = | 7 | ||
Shortform | = | 9 | ||
OpenTag | = | Shortform + 1 | ||
CloseTag | = | Shortform + 2 |
Take the data to parse and the bindings for the template. Store each in object variables, and then parse the template data for dynamic tags.