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

live_title contains newlines #3600

Open
lifeiscontent opened this issue Dec 25, 2024 · 1 comment
Open

live_title contains newlines #3600

lifeiscontent opened this issue Dec 25, 2024 · 1 comment

Comments

@lifeiscontent
Copy link

lifeiscontent commented Dec 25, 2024

Environment

  • Elixir version (elixir -v):
    Erlang/OTP 27 [erts-15.1.2] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1] [jit]

Elixir 1.17.3 (compiled with Erlang/OTP 25)

  • Phoenix version (mix deps): 1.7.18
  • Phoenix LiveView version (mix deps): 1.0.1
  • Operating system: MacOS
  • Browsers you attempted to reproduce this bug on (the more the merrier): N/A
  • Does the problem persist after removing "assets/node_modules" and trying again? Yes/no: N/A

Actual behavior

using mix format

    <.live_title default="Page" suffix=" · Phoenix">{assigns[:page_title]}</.live_title>

is always formatted to:

    <.live_title default="Page" suffix=" · Phoenix">
      {assigns[:page_title]}
    </.live_title>

which results in this output:

<title data-default="Page" data-suffix=" · Phoenix">
      Privacy Policy
     · Phoenix</title>

Expected behavior

<title data-default="Page" data-suffix=" · Phoenix">Privacy Policy · Phoenix</title>
@SteffenDE
Copy link
Collaborator

Is this a real problem? The title still shows correctly, as newlines are ignored. If you don't want the formatter to change the live_title, you can add phx-no-format:

<.live_title default="Page" suffix=" · Phoenix" phx-no-format>{assigns[:page_title]}</.live_title>

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

No branches or pull requests

2 participants