Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/template/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function createContents(parts) {
tableMode =
tableMode ||
signature.match(
/<\s*(table|th|tr|td|thead|tbody|tfoot|caption|colgroup)([^<>]|"[^"]*"|'[^']*')*>\s*$/,
/<\s*(table|th|tr|td|thead|tbody|tfoot|caption|colgroup)(?=[\s>/])([^<>]|"[^"]*"|'[^']*')*>\s*$/,
);

signature +=
Expand Down
14 changes: 14 additions & 0 deletions test/spec/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -839,6 +839,20 @@ describe("html:", () => {
expect(fragment.children[0].querySelectorAll("td").length).toBe(4);
});

it("should render custom elements with table tag prefix", () => {
define({ tag: "thead-element" });

const render = (value, className) => html`
<thead-element>${value}</thead-element>
<div class="${className}"></div>
`;

render("content", "test")(fragment);

expect(fragment.children[0].textContent).toBe("content");
expect(fragment.children[1].getAttribute("class")).toBe("test");
});

it("should set single expression in <tr> element", () => {
const render = html`
<table>
Expand Down
Loading