Daniel,

This is a really interesting idea!  However, I'm unsure whether it's wise
to bring this feature in without having the community test and validate it
first.  Would it be possible to release this as an extension first so we
can gauge its stability and desirability in "the real world"?

As far as the implementation goes, one thing I don't like is the complexity
involved to output unescaped HTML.  I'd strongly prefer to do something
like <?=raw($someVariable) ?> than having to instantiate a special class
every time I need to output some raw HTML.

Also, I know some templating systems (like Twig) allow you to specify
different escaping strategies:
http://twig.sensiolabs.org/doc/filters/escape.html  Would this proposed
feature have any similar functionality?

Best regards,

Colin

On Tue, Mar 22, 2016 at 9:26 AM Jan Tvrdík <j....@centrum.cz> wrote:

> On Tue, 22 Mar 2016 14:01:09 +0100, Craig Duncan <p...@duncanc.co.uk>
> wrote:
>
> >>
> >>
> >> Why do you assume that Latte parser is limited by regexp ability to
> >> parse
> >> HTML?
> >
> >
> > Because it is:
> >
> https://github.com/nette/latte/blob/19b759b550caaad75ca0dee5f0d85f9ffb59c845/src/Latte/Parser.php#L124
>
> No. That argument would only be valid, if the parser consisted only of a
> single regexp. When you combine PHP code with PCRE you loose nothing from
> PHP's turing completeness and it's ability to parse HTML.
>
> That being said I'm not claiming that Latte parser is 100 % correct HTML
> parser (neither is most existing HTML parsers in the world). I'm saying
> that it could be (to the extend of what's possible to statically analyze,
> i.e. if editor could highlight the code properly).
>
> Regards,
> Jan Tvrdik
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Reply via email to