cockpit-project/cockpit-machines

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

Opened this issue · 4 comments

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

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.

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

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!