this whole code block is really unreadable. Your custom variable replacement is not the way to go. Isn’t it possible to determine the data early and then fill in the correct values immediately?

Furthermore, why doesn’t the common `\t` and `\n` technique work here? You’re adding *a lot* of styles and code for just this one tooltip.