diff --git a/src/utils/html.ts b/src/utils/html.ts
index 557945dd..56edd5d8 100644
--- a/src/utils/html.ts
+++ b/src/utils/html.ts
@@ -1,29 +1,5 @@
import { escape } from 'entities';
-interface RawHtml {
- raw: true;
- contents: string;
-}
-
-/**
- * Options for r()
- */
-interface RawHtmlOptions {
- joiner?: string;
-}
-
-/**
- * Prevent values from being escaped by html``.
- * @param val Any value.
- * @returns An object that tells html`` to not escape `val` while building the HTML string.
- */
-export function r(val: any, options?: RawHtmlOptions): RawHtml {
- return {
- raw: true,
- contents: Array.isArray(val) ? val.join(options?.joiner ?? ' ') : val.toString(),
- };
-}
-
/**
* @param strings The constant portions of the template string.
* @param values The templated values.
@@ -35,16 +11,12 @@ export function r(val: any, options?: RawHtmlOptions): RawHtml {
* console.assert(testing === "foo bar baz oops<script>alert(1)</script>");
* ```
*/
-export function html(strings: TemplateStringsArray, ...values: (string | number | RawHtml)[]) {
+export function html(strings: TemplateStringsArray, ...values: (string | number)[]) {
const built = [];
for (let i = 0; i < strings.length; i++) {
built.push(strings[i] || '');
const val = values[i];
- if (typeof val !== 'undefined' && typeof val !== 'object') {
- built.push(escape((val || '').toString()));
- } else {
- built.push(val?.contents || '');
- }
+ built.push(escape((val || '').toString()));
}
return built.join('');
}