-
-
Notifications
You must be signed in to change notification settings - Fork 272
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug #859 [TwigComponent] Fixing bug where traditional blocks aren't h…
…andled correctly (weaverryan) This PR was squashed before being merged into the 2.x branch. Discussion ---------- [TwigComponent] Fixing bug where traditional blocks aren't handled correctly | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | Tickets | Fixes part of #844 (comment) | License | MIT Using `{% block traditional_block %}` inside of a `<twig:Component` syntax should now work. However, even though I tried to make the TwigPreLexer a bit more intelligent than just a regex parser, it's reaching its limits of complexity. Even this fix will break down if the user adds extra whitespace - e.g. `{% block traditional_block %}`. It's likely that `TwigPreLexer` will need to be converted to an actual Lexer -> token stream -> parser type of a system. On the bright side, that would make it easier to integrate into Twig core if we ever chose to do that (the parser wouldn't convert over directly, but the lexer & tokens in theory would). Cheers! Commits ------- 2ca9430 [TwigComponent] Fixing bug where traditional blocks aren't handled correctly
- Loading branch information
Showing
2 changed files
with
40 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters