blade-parser-typescript icon indicating copy to clipboard operation
blade-parser-typescript copied to clipboard

[Feature Request]: Support nested PHP tags

Open vinkla opened this issue 9 months ago • 1 comments

This plugin is excellent for formatting PHP templates with and without Blade syntax. Nested PHP tags do not appear to be indented unless there is HTML between them.

<?php if (have_posts()): ?>

<?php while (have_posts()): ?>

<article>
    <header>
        <h1><?php the_title(); ?></h1>
    </header>
</article>

<?php endwhile; ?>

<?php endif; ?>

It works better if you place an HTML tag between the if and while statements.

<?php if (have_posts()): ?>

<div>
    <?php while (have_posts()): ?>

    <article>
        <header>
            <h1><?php the_title(); ?></h1>
        </header>
    </article>

    <?php endwhile; ?>
</div>

<?php endif; ?>

vinkla avatar May 06 '24 18:05 vinkla