Hi,
You could use the
(encode)false parameter to display the correct HTML output of your custom macro. Problem could be that we had a bug in the 4.0 version that these macro parameters did not work correctly for custom macros. It was fixed in the 4.1 version that is why I would recommend you to
upgrade .
If the upgrade is not possible for you here is a code sample of workaround:
/// <summary>
/// Custom macro handler
/// </summary>
/// <param name="sender">Sender (active macro resolver)</param>
/// <param name="expression">Expression to resolve</param>
/// <param name="match">Returns true if the macro matches (was resolved)</param>
public static string ResolveCustomMacro(MacroResolver sender, string expression, out bool match)
{
match = false;
string result = expression;
// Add your custom macro evaluation
switch (expression.ToLower())
{
case "prepare": // {% ProcessCustomMacro("prepare", "") %}{%test|(encode)false%}
match = true;
result = "";
sender.OnGetValue += new MacroResolver.OnGetValueEventHandler(sender_OnGetValue);
break;
}
return result;
}
static object sender_OnGetValue(string name)
{
// Add your custom macro evaluation
switch (name.ToLower())
{
case "test": // {% ProcessCustomMacro("prepare", "") %}{%test|(encode)false%}
return "<strong> Strong text </strong>";
}
return null;
}
Then you could use this expression to call your macro: {% ProcessCustomMacro("prepare", "") %}{%test|(encode)false%}
Best regards,
Ivana Tomanickova