Conversation
For information, I was not able to fix the particular case of the selection element: when you open the sub-page to select amongs a list, if your label is defined as |
As a side note, I replaced the code in escapeURLPath by the code from Basic UI. Using |
@resetnow : could you please review this PR ? The changes are more or less the same changes you already reviewed for Basic UI. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The following testcase still demonstrates lack of escaping:
- Add the following to the sitemap:
Text item=DemoString label="Message [%s]" { Text item=DemoString label="Message [%s]" }
- Open ClassicUI and navigate into "Message" frame
- Type
smarthome update DemoString "test <i>test</i>"
- Page will update, and HTML tags in the frame header (at the top of the page) will not be escaped.
How do you enter a console command when you start OH from Eclipse ? An alternative to test your case would be to define a rule. |
I think console for input is already allocated in the default run configuration, just paste the command where the output is. |
I was not aware that it was possible ! But it works.I can confirm your test case. |
@resetnow : what's wrong with that HTML code: |
Same problem with an hardcoded label in sitemap like this one:
|
It seems to be exactly the same problem I found in the selection list and I was not able to fix it ! |
I'm curious why you'd ask something to be rendered in italics and then be surprised when it's rendered in italics? |
We just want to display the value of an item that can contain anything without any interpretation by the HTML browser. Italic was just an example but the problem is in fact with any XML tag. |
Maybe this has a solution? |
I will have to try how Basic UI handles that case. As the escaping code is the same in Basic UI and Classic UI, U would not understand why it us correct in Basic UI and not in Classic UI. |
One possible case is that the data transferred in a long-polling request are escaped only once. Since long-polling response is an XML document itself and "title" element doesn't have CDATA escaping, all the HTML entities are transformed back into their respective symbols once the document tree is parsed in broswer.
https://github.com/eclipse/smarthome/blob/067bd5122b4666452bda319cb4e1de13eda9ab00/extensions/ui/org.eclipse.smarthome.ui.classic/snippets/layer.html#L216:56
|
I just checked the layer.html in Basic UI and I can find this: |
Fix #3743 Signed-off-by: Laurent Garnier <lg.hc@free.fr>
Problem with title is now fixed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thank you all! |
Fix #3743
Signed-off-by: Laurent Garnier lg.hc@free.fr