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

The VM description doesn't display the '\n' #1890

Open
yunmingyang opened this issue Nov 1, 2024 · 4 comments
Open

The VM description doesn't display the '\n' #1890

yunmingyang opened this issue Nov 1, 2024 · 4 comments
Assignees

Comments

@yunmingyang
Copy link
Contributor

Description of problem:
When setting a description for a VM, if setting a '\n' in the description, like '
1

2
'. The \n is not shown on the page. But, if checking by 'virsh dumpxml ${vm}', the '\n' could be shown correctly in the element

Version-Release number of selected components (if applicable):
cockpit-machines-322-11-g63ac3f46

@mvollmer
Copy link
Member

mvollmer commented Nov 1, 2024

I can't reproduce this, and I am not sure I have followed your steps correctly.

If put this into the dialog:

image

I get this in the details page of the machine:

image

The two lines 1\n and 2 are both shown, and the \n sequence is also rendered correctly.

Sequences like \n have no special meaning when you type them into the description dialog. Did you expect them to be interpreted and turned into a newline character? If you want multiple lines, just put multiple lines into the text field.

@mvollmer mvollmer self-assigned this Nov 1, 2024
@yunmingyang
Copy link
Contributor Author

Screenshot from 2024-11-04 13-48-51

@yunmingyang
Copy link
Contributor Author

Just like that, for \n, I mean typing enter @mvollmer

@mvollmer
Copy link
Member

Just like that, for \n, I mean typing enter @mvollmer

Ahh, you mean an empty line! :-)

Yes, I can reproduce that. Empty lines are indeed omitted when displaying a description. Thanks for finding this!

mvollmer added a commit to mvollmer/cockpit-machines that referenced this issue Nov 11, 2024
Render the description as a single paragraph, with preserved line
breaks and word breaking on overflow.

Fixes cockpit-project#1888, cockpit-project#1890.
mvollmer added a commit to mvollmer/cockpit-machines that referenced this issue Nov 11, 2024
Render the description as a single paragraph, with preserved line
breaks and word breaking on overflow.

Fixes cockpit-project#1888, cockpit-project#1890.
mvollmer added a commit that referenced this issue Nov 26, 2024
Render the description as a single paragraph, with preserved line
breaks and word breaking on overflow.

Fixes #1888, #1890.
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