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

Formatting issue when using <LineBreak/> in content #513

Closed
Smallgiil opened this issue Oct 2, 2024 · 2 comments
Closed

Formatting issue when using <LineBreak/> in content #513

Smallgiil opened this issue Oct 2, 2024 · 2 comments

Comments

@Smallgiil
Copy link

Describe the bug
When I use in the content of my XAML element, XAML Styler stops writting the closing tag on a new line. Instead, it appends it right after the content, on the same line.

To Reproduce
Steps to reproduce the behavior:

  1. Take following XAML content:
<TextBlock Margin="2">
    First line.<LineBreak />
    Second line.
</TextBlock>
  1. Save the file with the default XAML Styler configuration.
  2. See that we get this result:
<TextBlock Margin="2">
    First line.<LineBreak />
    Second line.</TextBlock>
  1. Remove the element in the content.
  2. Save again.
  3. See that you get a different result:
<TextBlock Margin="2">
    First line.
    Second line.
</TextBlock>

Expected behavior

We should get the same result, whether we use elements or not.

External Configuration

Settings.XamlStyler.json

Version Info (please complete the following information):

  • OS: Windows 10 Version 22H2 Build 19045.4894
  • Visual Studio: Professional 17.12.0 Preview 1
  • XAML Styler: 3.2404.2
@Smallgiil Smallgiil added the Bug label Oct 2, 2024
@Smallgiil
Copy link
Author

Smallgiil commented Oct 2, 2024

Note that xml:space="preserve" fixes the issue but changes the behavior (I got too many new lines if my final textblock).

@grochocki
Copy link
Contributor

This appears to be a dupe of #510. Closing to continue the discussion there, but if I am mistaken and this is different, we can reopen.

@grochocki grochocki closed this as not planned Won't fix, can't repro, duplicate, stale Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants