cockpit-project / cockpit-machines

Cockpit UI for virtual machines
GNU Lesser General Public License v2.1
293 stars 74 forks source link

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

Open yunmingyang opened 3 days ago

yunmingyang commented 3 days ago

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 commented 3 days ago

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.

yunmingyang commented 14 hours ago

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

yunmingyang commented 14 hours ago

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