Having a issue with a razor macro in Umbraco 4.11.10 which really has me stumped,
The problem:
Having html elements inside a textbox multiline field "breaks" attribute boundary's when executing the razor script.
More details:
The basic macro has a textbox multiple field which is passed into the razor script as a parameter.
With plain text this works great but a recent requirement requires tags being added to this text at various points.
What I have tried:
Initially I tried escaping the html like this
>sup<1,2>/sup<
This worked great until I reloaded the node and republished, when looking in the db, it seems the first time the macro is saved, the correct escaped html is included as the macro parameter:
description="(text here)>sup<1,2>/sup<(more text)" ...
When the node is reloaded the rendered output is the actual html characters (assuming this is decoded before being displayed in the umbraco backend).
<sup>1,2</sup>
which when republished is passed "as is" to the Razor macro.
description="SINGLE (n=833) <sup>1,2</sup>
This then outputs from the end of the first html tag to the end of the macro parameters as its output:
<p> ***+ ***vs ***(Should Stop Here)" hideBorder="0" preview="0" /></p>
which should be
blah blah blah + **vs *(Should Stop Here)" hideBorder="0" preview="0" />
The Question:
My question is, is there any way to add html elements to a textbox multiple when used as a razor parameter, or a way to stop the decoding when the node is reloaded.
Because of legacy and the impact I would prefer not to change the macro/parameters if at all possible but if its a must its a must.
Thanks for taking the time to read!