diff --git a/src/reactTemplates.js b/src/reactTemplates.js index dae0cd1..5276048 100644 --- a/src/reactTemplates.js +++ b/src/reactTemplates.js @@ -242,7 +242,7 @@ function convertHtmlToReact(node, context) { } function extractDefinesFromJSXTag(html, defines) { - html = html.replace(/\<\!doctype jsx\s*(.*?)\s*\>/i, function(full, reqStr) { + html = html.replace(/\<\!doctype rt\s*(.*?)\s*\>/i, function(full, reqStr) { var match = true; while (match) { match = false; @@ -301,7 +301,7 @@ function convertFile(source, target) { } var html = fs.readFileSync(source).toString(); - if (!html.match(/\<\!doctype jsx/i)) { + if (!html.match(/\<\!doctype rt/i)) { throw new Error('invalid file, missing header'); } var js = convertTemplateToReact(html); diff --git a/test/data/div.rt b/test/data/div.rt index 5ab1014..b7c24b3 100644 --- a/test/data/div.rt +++ b/test/data/div.rt @@ -1,3 +1,3 @@ - +
\ No newline at end of file diff --git a/test/data/lambda.rt b/test/data/lambda.rt index cd8baf9..1d36791 100644 --- a/test/data/lambda.rt +++ b/test/data/lambda.rt @@ -1,4 +1,4 @@ - +
diff --git a/test/data/repeat.rt b/test/data/repeat.rt index 5accbbb..47b2970 100644 --- a/test/data/repeat.rt +++ b/test/data/repeat.rt @@ -1,4 +1,4 @@ - +

+
Item:#{itemIndex} = {item} diff --git a/test/data/test.rt b/test/data/test.rt index 3fc8a1f..db9d7b2 100644 --- a/test/data/test.rt +++ b/test/data/test.rt @@ -1,4 +1,4 @@ - +