VolkovLabs / volkovlabs-dynamictext-panel

Business Text Panel for @grafana
https://docs.volkovlabs.io
Apache License 2.0
78 stars 14 forks source link

if html has line breaks then rendering does not work #222

Closed samant-rags closed 7 months ago

samant-rags commented 8 months ago

So if the HTML has a line break for code clarity , the UI breaks as shown. if we remove the line break it works fine . Can this be handled so that we can have line breaks in html content ?

image

samant-rags commented 8 months ago

`

  • Not Started : 235
  • In Progress : 300
  • Completed : 100

`

jbasko commented 7 months ago

This is a really annoying bug. I think what happens is that the plugin or the editor automatically formats the code and the indented blocks become quoted text in markdown and it is then rendered verbatim.

Thanks @samant-rags for the suggested work-around - remove any blank lines!

Just in case it's not clear how to get this:

  1. Have some {{#if}} and {{#each}} stuff, have some line breaks in HTML code. Do not indent any code!
  2. Make sure it renders nicely.
  3. Save the changes or just apply the panel changes.
  4. Then choose to edit panel again.
  5. The editor formats the code and now it has indentation which breaks the renderer as it takes the indented code to be displayable code to be printed verbatim. Even though at the same time it does variable interpolation!
asimonok commented 7 months ago

@samant-rags @jbasko we will add an option to disable wrapping in the upcoming release - https://github.com/VolkovLabs/volkovlabs-dynamictext-panel/pull/235 It will solve the issue with printing code if there are empty lines.