1
0
mirror of https://github.com/bobwen-dev/react-templates synced 2025-04-12 00:56:39 +02:00

Supporting doctype in ignorecase

This commit is contained in:
amitk 2014-11-11 00:49:02 +02:00
parent 2fd3a14879
commit 3ebd918cea
2 changed files with 3 additions and 3 deletions

View File

@ -194,7 +194,7 @@ function convertHtmlToReact(node, context) {
}
function extractDefinesFromJSXTag(html, defines) {
html = html.replace(/\<\!doctype jsx\s*(.*?)\s*\>/, function(full, reqStr) {
html = html.replace(/\<\!doctype jsx\s*(.*?)\s*\>/i, function(full, reqStr) {
var match = true;
while (match) {
match = false;
@ -240,7 +240,7 @@ function convertFile(source, target) {
// return;// only handle html files
// }
var html = fs.readFileSync(source).toString();
if (!html.match(/\<\!doctype jsx/)) {
if (!html.match(/\<\!doctype jsx/i)) {
console.log('invalid file, missing header');
return;
}

View File

@ -1,4 +1,4 @@
<!doctype jsx>
<!DOCTYPE jsx>
<p>
<div rt-repeat="items in this.props.things">
<span style="width:auto;line-height: 5px;" onClick="(evt)=>this.happend(evt);return false;">Mock</span>