question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] floorplan.text_set wrap the output text inside a <title/> tag

See original GitHub issue

Describe 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

  1. Create a simple SVG with a text tag <text id="temperature"></text> inside
  2. 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 alt text

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:closed
  • Created 2 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
exeticocommented, Sep 25, 2021

Fixed with #144 - Thanks!

1reaction
exeticocommented, Sep 7, 2021

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! 🎉

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found