Am 17.05.2014 17:57, schrieb Subramanya Sastry:
On 05/17/2014 10:51 AM, Subramanya Sastry wrote:
So, going back to your original implementation,
here are at least 3 ways I see
this working:
2. action=expandtemplates returns a <html>...</html> for the expansion of
{{T}}, but also provides an additional API response header that tells Parsoid
that T was a special content model page and that the raw HTML that it received
should not be sanitized.
Actually, the <html></html> wrapper is not even required here since the new
API
response header (for example, X-Content-Model: HTML) is sufficient to know what
to do with the response body.
But that would only work if {{T}} was the whole text that was being expanded (I
guess that's what you do with parsoid, right? Took me a minute to realize that).
expandtemplates operates on full wikitext. If the input is something like
== Foo ==
{{T}}
[[Category:Bla}}
Then expanding {{T}} without a wrapper and pretending the result was HTML would
just be wrong.
Regarding trusting the output: MediaWiki core trusts the generated HTML for
direct output. It's no different from the HTML generated by e.g. special pages
in that regard.
I think something like <html transclusion="{{T}}"
model="whatever">...</html>
would work best.
-- daniel