diff --git a/src/reactTemplates.js b/src/reactTemplates.js index e840a60..0b93952 100644 --- a/src/reactTemplates.js +++ b/src/reactTemplates.js @@ -584,6 +584,8 @@ function parseAndConvertHtmlToReact(html, context) { throw RTCodeError.build(context, rootNode.root()[0], 'Document should have a single root element'); } else if (firstTag.name === virtualNode) { throw RTCodeError.build(context, firstTag, `Document should not have <${virtualNode}> as root element`); + } else if (_.includes(_.keys(firstTag.attribs), repeatAttr)) { + throw RTCodeError.build(context, firstTag, "root element may not have a 'rt-repeat' attribute"); } return convertHtmlToReact(firstTag, context); } diff --git a/test/data/invalid/invalid-repeat-1.rt b/test/data/invalid/invalid-repeat-1.rt new file mode 100644 index 0000000..7cd3c6e --- /dev/null +++ b/test/data/invalid/invalid-repeat-1.rt @@ -0,0 +1,3 @@ +