I'm trying to use SMW SRF to return the results of a ASK statement as lines of unprocessed text within some other parser call (say Mermaid [1])
Here is an example of the parser function result I'm trying to emulate:
{{#mermaid:gantt Event1: myevent1, 2018/10/18, 1d Event2: myevent2, 2018/10/20, 1d }}
Here is the way I am coding it:
{{#mermaid:gantt {{#ask: [[Category:Foo]] |?has name |?has date |link=none |format=template |template=Foo-item |import-annotation=true |sep=\n }} }}
It works perfectly for a single result but not for multiple results.
Here is what the resulting html source looks like:
<div id="ext-mermaid-57345bc89a90cf8bf" class="ext-mermaid" data-mermaid="{"content":"gantt\n Event1: myevent1, 2018\/10\/18, 1d\\n Event2: myevent2, 2018\/10\/20, 1d","config":{"theme":"forest"}}"><div class="mermaid-dots"></div></div>
By inspecting the html source of the rendered page, I can see that the problem is that the "\" in the SEP of the results is ultimately getting printed as "\\n" in the final HTML.
I know that what it needs to be to work is this:
<div id="ext-mermaid-57345bc89a90cf8bf" class="ext-mermaid" data-mermaid="{"content":"gantt\n Event1: myevent1, 2018\/10\/18, 1d\n Event2: myevent2, 2018\/10\/20, 1d","config":{"theme":"forest"}}"><div class="mermaid-dots"></div></div>
Does anyone know a way that I can avoid having the SRF output formatter (or the MW output formatter) add the extra "\" to the "\n"?