[ALOY-6] Generated HTML object tree full of whitespace elements
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-07-19T11:52:03.000+0000 |
Affected Version/s | 2012 Sprint 14 |
Fix Version/s | 2012 Sprint 14 |
Components | XML |
Labels | n/a |
Reporter | Tony Lukasavage |
Assignee | Tony Lukasavage |
Created | 2012-05-18T13:27:17.000+0000 |
Updated | 2014-06-22T13:21:17.000+0000 |
Description
Something is wrong with the html.pegjs grammar for HTML. It is generating loads of unnecessary elements in the generated object tree that will make parsing more difficult and time consuming in terms of performance.
here's a snippet of what I'm seeing:
[ { tag: 'html',
attrs: [],
body:
[ '\n\t',
{ tag: 'head',
attrs: [],
body:
[ '\n\t\t',
{ tag: 'title',
attrs: [],
body: [ 'Declarative UI Master Detail Test' ] },
'\n\t\t',
{ tag: 'script',
attrs: [ [ 'src', '/controller/index.js' ] ],
body: [] },
'\n\t\t',
{ tag: 'style',
attrs: [],
body: [ '\n\t\t#mainWindow {\n\t\t\t-ti-layout: \'vertical\';\n\t\t\t-ti-navBarHidden: true;\n\t\t\t-ti-backgroundColor: \'#00a\';\n\t\t}\n\t\t' ] },
'\n\t' ] },
'\n\t',
// and so on....
We need to correct the HTML grammar so that these whitespace elements are no longer included in the generated object tree.
Details here: [https://github.com/appcelerator/ZipTi/commit/8e1e091f5c5eb0a5c6bdd1c8e9e2da6dd5041ae0](https://github.com/appcelerator/ZipTi/commit/8e1e091f5c5eb0a5c6bdd1c8e9e2da6dd5041ae0)