Skip to content

Inject PHP code without PHP tags #168

@calebdw

Description

@calebdw

Hello!

I'm trying (somewhat unsuccessfully, but trying nonetheless) to write a parser for the Laravel Blade templating system. I've captured the code content between the output directives (e.g., {{ $fooBar->some_attribute }}) but when I inject the content the parser thinks it ($fooBar->some_attribute) is just text.

If I do the following then the parser recognizes it as a variable and properly highlights it, however, this defeats the whole purpose of the templating system:
{{ <?php $fooBar->some_attribute ?> }}

Something similar occurs in markdown file with PHP fenced content:

E.g., here the php parser thinks the content is just text
image

whereas it's a variable assignment with the php tags
image

Is there a way to have the parser recognize the content as php without explicitly declaring the php tags?

Thanks!

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