Skip to content

PHP grammar is injected into itself #82

@Ingramz

Description

@Ingramz

An Atom user found an interesting bug: atom/language-php#326

Namely what is happening is that from the injection selector: ^text.html - (meta.embedded | meta.tag), L:^text.html meta.tag, L:text.html.php source.js the last two alternatives L:^text.html meta.tag and L:text.html.php source.js do not exclude the meta.embedded.block.php scope. This causes the PHP part of the grammar to be injected into itself in these two cases.

Here are all three cases to test with, from which the last two are currently misbehaving:

<?php /* <?php echo 'test'; ?> */ ?>

<script type="text/javascript">
  var str = "<?php /* <?php echo 'test'; ?> */ ?>";
</script>

<img style="<?php /* <?php echo 'test'; ?> */ ?>" />

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions