[BUG] floorplan.text_set wrap the output text inside a <title/> tag
See original GitHub issueDescribe the bug
When I use floorplan.text_set
to display the state of an entity, the output text is wrapped inside a <title> tag.
Text value is not visible because a title in a text tag is probably not a valid SVG semantic.
To Reproduce
- Create a simple SVG with a text tag
<text id="temperature"></text> inside
- Add a rule to set the text tag with an entity state.
rules:
- element: temperature
entity: sensor.my_temperature
state_action:
- service: floorplan.text_set
service_data: '${entity.state ? entity.state + "°C" : "unknown"}'
Expected behavior
<text id="temperature">29°C</text>
Observed behavior
<text id="temperature"><title>29°C</title></text>
Screenshots
Desktop (please complete the following information):
- OS: MacOSX 11.2.2
- Browser: Chrome 93.0.4577.63 (Official Build) (x86_64)
- HA: 2021.9.1 (HAOS x86 on a NUC)
- HA Frontend: 20210830.0
- ha-floorplan: 1.0.27
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Wrapping and breaking text - CSS: Cascading Style Sheets
This guide explains the various ways in which overflowing text can be managed in CSS.
Read more >How do I wrap text in a pre tag? - html - Stack Overflow
I have multiple divs on one HTML output screen that would need this. Seems like a single fix to the element in the...
Read more >How to Wrap Text in a <pre> Tag with CSS - W3docs
The tag inserts a preformatted text into an HTML document. Since the tag doesn't support wrapping, we'll show how to do it with...
Read more >Specify the text-wrapping options for a control
Right-click the control for which you want to enable or disable text wrapping, and then click Control Properties on the shortcut menu. Click...
Read more >textwrap — Text wrapping and filling — Python 3.11.1 ...
Wraps the single paragraph in text (a string) so every line is at most width characters long. Returns a list of output lines,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fixed with #144 - Thanks!
I totally agree, and have already asked @pkozul about the current logics. It’s clear that we’re forcing the titel-tag, and I need to know how inportant it actually is 😊👍.
Due to lag of time, I’ve not found time to run through the related logics.
I’m glad that you figured it out. And if no fix are provided, I’d definitely add that!
Off-topic: What a great idea to style the temps., like you’ve done! 🎉