Skip to content

Invalid code when namespace is followed by HTML comment #1052

@joemaller

Description

@joemaller

@prettier/plugin-php v0.10.2
Playground link

Input:

<?php namespace foo; ?>

<!-- HTML comment -->

Output:

<?php namespace foo;



<!-- HTML comment -->

Expected behavior:

<?php  namespace foo; ?>

<!-- HTML comment -->

Current output is invalid.

Notes:
This seems to be specific to namespace declarations. I wasn't able to reproduce the problem with other declarations, assignments or function calls.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions