I was trying to build some strings for formatting like so:
Code: Select all
[h: headingDv = strformat('<div style = "width:auto; background-color:#C0C0C0; color:#000000; margin:0px; padding:3px; font-size:1em; font-weight:bold;">')]
[h: textDv = strformat('<div style = "width:auto; background-color:#EEEEAA; color:#000000; margin:0px; padding:2px; font-size:1em;">')]
[h: dvEnd = strformat('</div>')]
...because there's an open <div> in the STRING BUILDER, that isn't closed IN ANOTHER STRING. ARGHGHAGHASDFHH!!@#$!@#$!!! (humourous anger intended).
It took a good long while to track down the solution, seen here:
Code: Select all
[h:"<!-- every string that has <div> or <span> in it (including THIS COMMENT!) must have a matching </div> or </span> -->"]
[h:"<!-- otherwise, a blank line of output is created. -->"]
[h:"<!-- so if you create a string with an opening tag in it, you MUST close that tag, even if it doesn't display anywhere -->"]
[h: headingDv = strformat('<div style = "width:auto; background-color:#C0C0C0; color:#000000; margin:0px; padding:3px; font-size:1em; font-weight:bold;">')]
[h: dvEnd = strformat('</div>')]
[h: textDv = strformat('<div style = "width:auto; background-color:#EEEEAA; color:#000000; margin:0px; padding:2px; font-size:1em;">')]
[h:"<!-- </div> -->"]
p.s. If I'm wrong, please gosh correct me, but this was the solution I ended up with.
p.p.s. v1.11.5