Skip to content

[6.x] Corrects Issues with Directive Node Parsing#13938

Open
JohnathonKoster wants to merge 3 commits intostatamic:6.xfrom
JohnathonKoster:bugfix/directive-keyword-collisions
Open

[6.x] Corrects Issues with Directive Node Parsing#13938
JohnathonKoster wants to merge 3 commits intostatamic:6.xfrom
JohnathonKoster:bugfix/directive-keyword-collisions

Conversation

@JohnathonKoster
Copy link
Contributor

This PR corrects an issue where the new directive parsing could cause issues with standalone words that match (aware, props, cascade).

The Problem

There were three problematic scenarios discovered when investigating the issue:

  1. Words that collided with directive names would get caught up in the directive parsing accidentally
  2. Created directive nodes missing their $parser instances, resulting in Call to a member function getText() on null exceptions
  3. Depending on how you constructed your template, it was possible to get content before the directive to become duplicated when attempting to workaround the issue

The Fixes

  1. The directive regular expression was improved to help prevent standalone words from matching. Additionally, improved lookahead parsing was implemented to not capture @props or @aware without arguments.
  2. All created directive nodes now correctly have their parser instances set
  3. Proper escaped node handling for directives was implemented

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant