Repository navigation
Add Better Parse Warnings To recursive-parser Branch - #244
Conversation
|
Wouldn't it be easier to just render the template to get the warnings? :-) |
There was a problem hiding this comment.
Why do we need this if we already have @nodelist?
|
Rendering the template is not a good option because then you could get other errors from missing filters or bad dummy data. Also performance. |
There was a problem hiding this comment.
I believe this is always true (since @children is never nil or false)
There was a problem hiding this comment.
This is to guard against calling warnings before parsing, but you're right, parse is called on initialization so that can't happen.
|
Ok fixed all the issues, how's it look now? |
|
@fw42 is this OK to merge into the recursive-parsing branch? |
|
Since this is also affecting the non-strict parser, can I get a performance benchmark? |
There was a problem hiding this comment.
I think that comment is unnecessary
|
Code looks good. Merge it. |
Add Better Parse Warnings To recursive-parser Branch
@fw42 @arthurnn
Allows the warnings to be retrieved in
:warnmode without rendering the template.Links up all the tags in a proper parse tree where each tag has links to all its children so it can recursively get information from them.
Note that this PR merges into the
recursive-parsingbranch.This is necessary for situations where you want to verify a template is syntactically correct and issue warnings if it is not but without rendering it, such as a template editor.