Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add support for inline comments #4349

Merged
merged 1 commit into from
Sep 27, 2024
Merged

Add support for inline comments #4349

merged 1 commit into from
Sep 27, 2024

Conversation

fabpot
Copy link
Contributor

@fabpot fabpot commented Sep 26, 2024

Closes #4001

@stof
Copy link
Member

stof commented Sep 26, 2024

I suggest adding tests covering that a # inside strings is not triggering the parsing as inline comments

@fabpot
Copy link
Contributor Author

fabpot commented Sep 27, 2024

I suggest adding tests covering that a # inside strings is not triggering the parsing as inline comments

Added

@fabpot fabpot force-pushed the inline-comments branch 2 times, most recently from 24ef48b to cb818ba Compare September 27, 2024 05:30
@fabpot fabpot merged commit 1e4ceff into twigphp:3.x Sep 27, 2024
10 checks passed
@fabpot fabpot deleted the inline-comments branch September 27, 2024 05:32
smnandre added a commit to symfony/ux that referenced this pull request Sep 27, 2024
This PR was squashed before being merged into the 2.x branch.

Discussion
----------

[Doc] Misc updates in TogglePassword docs

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| Issues        | -
| License       | MIT

Twig recently added inline comments (twigphp/Twig#4349) and this doc was used an example of invalid Twig syntax (twigphp/Twig#4001). So, let's fix it.

Commits
-------

11276a0 [Doc] Misc updates in TogglePassword docs
javiereguiluz added a commit to symfony-tools/docs-builder that referenced this pull request Sep 30, 2024
This PR was merged into the main branch.

Discussion
----------

Add support for inline Twig comments

Twig added inline comments (twigphp/Twig#4349) so I tried to add support for them here. But, it's not working. Anyone knows if this could be easy to fix or if it's too complex to do it? Thanks!

Commits
-------

126cfbf Add support for inline Twig comments
@VincentLanglet
Copy link
Contributor

Hi, I dunno if it was wanted but I feel like inline comment also works inside interpolation

{{ "#{1 # This is a comment
         ~ 1}" }}

smnandre added a commit to smnandre/ux that referenced this pull request Dec 22, 2024
Twig introduced the inline comments in twigphp/Twig#4349

This PR add minimal support for it the PreLexer / HTML syntax

```twig
<twig:Button
    # comment
    bar="bar"
/>
```

I'd like some IRL feedbacks on this one :)
smnandre added a commit to smnandre/ux that referenced this pull request Dec 22, 2024
Twig introduced the inline comments in twigphp/Twig#4349

This PR add minimal support for it the PreLexer / HTML syntax

```twig
<twig:Button
    # comment
    bar="bar"
/>
```

I'd like some IRL feedbacks on this one :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Allow comments within components / function calls
3 participants