bmarian / token-tooltip-alt

A module that adds a tooltip next to the currently hovered token to show some useful information for players and DMs.
MIT License
9 stars 15 forks source link

[BUG] Refreshing the windows adds white space to every line after the first #66

Closed bmarian closed 3 years ago

bmarian commented 3 years ago

Describe the bug Refreshing the TooltipEditor will populate the textareas with a lot of white spaces before each line.

Screenshots image

Moerill commented 3 years ago

Are you filling the textarea using handlebars?

I noticed that as well at one point. It does seem like (for some reason) handlebars (or maybe the textarea) does add all the indenting of the html file to its content. My solution was: insert the textarea content onRender/activateListener inside the textarea. While not beautiful it does work..

bmarian commented 3 years ago

yes, using hb.. and I was trying to avoid doing it in activeListener... but I think that's my only option as I wasted 2h already.

Moerill commented 3 years ago

ye its sadly the only solution that i found that worked. Seems like no one used handlebars to inject stuff into textareas before, for some reason. (although thinking about it: did you try testing using {{{ vs {{ ?

in my usecase the scaped version was no option, not if its here.

bmarian commented 3 years ago

Things I've tried: {{~" "}}{{{value}}}{{~" "}} {{~" "}}{{value}}{{~" "}} {{{value}}}