I use riot/ssr to compile .riot to .html, the template tag with the is attribute will be directly displayed as <template is='...'></template> in compiled .html.
I have run the following node.js script using riot/ssr to compile the above .riot file into HTML.
(By the way, I also use Riot as a tool to generate static HTML in this way, just like Pug or EJS. It's very comfortable! 😃)
I tried this combination of the template tag and is directive in a normal compilation without SSR,
but the above result was only obtained when using riot/ssr.
I have prepared a sample for this issue.
https://github.com/nibushibu/riot-ssr-template-tag-bug/tree/main
I use riot/ssr to compile
.riot
to.html
, thetemplate
tag with theis
attribute will be directly displayed as<template is='...'></template>
in compiled.html
.html-base.riot
index.riot
I have run the following node.js script using riot/ssr to compile the above .riot file into HTML. (By the way, I also use Riot as a tool to generate static HTML in this way, just like Pug or EJS. It's very comfortable! 😃)
↓↓↓
compiled index.html from index.riot
Expected index.html (It is desirable that
<template>
and</template>
are not output.)I tried this combination of the
template
tag andis
directive in a normal compilation without SSR, but the above result was only obtained when using riot/ssr.This seems to be due to the following changes made in the latest version of Riot.js v5.4.3. https://github.com/riot/riot/commit/b2afbb883a3c79f0534edc670376de67b384c985#diff-8ab20e4abf785f767031d866e0bd9245d7093cf4067d707da24a00bd3e253bf8R278
As a test, I reverted
isTemplate()
in riot/util/check.js to the code from v5.3.2, and got the expected result.