Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

If statements without spaces #176

Open
reindert-vetter opened this issue May 15, 2023 · 1 comment
Open

If statements without spaces #176

reindert-vetter opened this issue May 15, 2023 · 1 comment

Comments

@reindert-vetter
Copy link

reindert-vetter commented May 15, 2023

The if statements require extra spaces. I let variables determine whether an image should be placed on the left or right. For this, I use Tailwind classes. It would be user-friendly if I could type the classes without spaces:

<div class="@if($position == 'left')-order-1@endif">

I have made the following tests. The first one passed without doing anything, but I cannot get the second one to work.

    /**
     * @throws \Exception
     */
    public function testIfBeginningWithoutSpace()
    {
        $bladeSource = /** @lang Blade */
            <<<'BLADE'
@if(true)string @endif
BLADE;
        $this->assertEqualsIgnoringWhitespace("string", $this->blade->runString($bladeSource));
    }

    /**
     * @throws \Exception
     */
    public function testIfEndingWithoutSpace()
    {
        $bladeSource = /** @lang Blade */
            <<<'BLADE'
@if(true) string@endif
BLADE;
        $this->assertEqualsIgnoringWhitespace("string", $this->blade->runString($bladeSource));
    }

Is this something you see as an easy fix? Anyway, thank you for your effort!

@jorgecc
Copy link
Member

jorgecc commented Jun 9, 2023

I have been a bit busy but I will check it.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants