Is there any way to use it with createBundleRenderer ? this function outputs the ssr bundle with html and then i'm using this html in .renderToString() function.
So when i'm adding ${meta.text()} to the res.send() my rendered html file becoming weird and not semantic. I mean meta tags are not in < head> and etc.
Thanks.
I found a solution. if anyone interested just add {{{ meta.inject().title.text() }}} and other meta props in template.html
This works, however, the Vue SSR docs discourage the usage of {{{ }}} and warn us of potential XSS attacks:
Use double-mustache (HTML-escaped interpolation) to avoid XSS attacks.
https://ssr.vuejs.org/en/head.html (See "Notes" at the bottom)
I know this, but for now i don't know how to inject it to html. double mustaches just output it as text..
Is there an alternative approach than using {{{ }}}?
@Atinux @declandewet ping
@Atinux - any update on @newenegue's previous comment?
Actually, meta.inject().title.text() render escaped HTML so you can have to use {{{ }}}.
Example: title: '<b>Coucou</b>'
$meta().inject().title.text() => <title data-vue-meta="true"><b>Coucou</b></title>
Oh, perfect.
Should we update this in doc?
A PR would be awesome :)
@Atinux - here you go - https://github.com/declandewet/vue-meta/pull/156
Most helpful comment
Actually,
meta.inject().title.text()render escaped HTML so you can have to use{{{ }}}.Example:
title: '<b>Coucou</b>'$meta().inject().title.text() =>
<title data-vue-meta="true"><b>Coucou</b></title>