Skip to content

Commit 8ff7dc1

Browse files
committed
use htl.html for html cells
1 parent 32770af commit 8ff7dc1

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

src/javascript/__snapshots__/template.test.ts.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,11 @@ Node {
123123
}
124124
`;
125125

126-
exports[`transpiles a html template with an interpolated expression 1`] = `"html\`Hello, \${"world"}!\`"`;
126+
exports[`transpiles a html template with an interpolated expression 1`] = `"htl.html\`Hello, \${"world"}!\`"`;
127127

128-
exports[`transpiles a html template with backquotes 1`] = `"html\`Hello, \\\`world\\\`!\`"`;
128+
exports[`transpiles a html template with backquotes 1`] = `"htl.html\`Hello, \\\`world\\\`!\`"`;
129129

130-
exports[`transpiles a html template with backslashes 1`] = `"html\`Hello, \\world\\!\`"`;
130+
exports[`transpiles a html template with backslashes 1`] = `"htl.html\`Hello, \\world\\!\`"`;
131131

132132
exports[`transpiles a markdown template with an interpolated expression 1`] = `"md\`Hello, \${"world"}!\`"`;
133133

@@ -137,7 +137,7 @@ exports[`transpiles a markdown template with backslashes 1`] = `"md\`Hello, \\\\
137137

138138
exports[`transpiles a node template with backslashes 1`] = `"Interpreter("node", {id: 1, format: "buffer"}).run(\`Hello, \\\\world\\\\!\`).then((file) => file.arrayBuffer())"`;
139139

140-
exports[`transpiles a simple html template 1`] = `"html\`Hello, world!\`"`;
140+
exports[`transpiles a simple html template 1`] = `"htl.html\`Hello, world!\`"`;
141141

142142
exports[`transpiles a simple markdown template 1`] = `"md\`Hello, world!\`"`;
143143

src/javascript/template.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,9 @@ function getPrefix(cell: Cell): string {
122122
? getSqlPrefix(cell)
123123
: isInterpreter(cell.mode)
124124
? getInterpreterPrefix(cell)
125-
: cell.mode;
125+
: cell.mode === "html"
126+
? "htl.html"
127+
: cell.mode;
126128
}
127129

128130
function getSqlPrefix(cell: Cell): string {

0 commit comments

Comments
 (0)