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:
parent
2fd3a14879
commit
3ebd918cea
@ -194,7 +194,7 @@ function convertHtmlToReact(node, context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function extractDefinesFromJSXTag(html, defines) {
|
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;
|
var match = true;
|
||||||
while (match) {
|
while (match) {
|
||||||
match = false;
|
match = false;
|
||||||
@ -240,7 +240,7 @@ function convertFile(source, target) {
|
|||||||
// return;// only handle html files
|
// return;// only handle html files
|
||||||
// }
|
// }
|
||||||
var html = fs.readFileSync(source).toString();
|
var html = fs.readFileSync(source).toString();
|
||||||
if (!html.match(/\<\!doctype jsx/)) {
|
if (!html.match(/\<\!doctype jsx/i)) {
|
||||||
console.log('invalid file, missing header');
|
console.log('invalid file, missing header');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<!doctype jsx>
|
<!DOCTYPE jsx>
|
||||||
<p>
|
<p>
|
||||||
<div rt-repeat="items in this.props.things">
|
<div rt-repeat="items in this.props.things">
|
||||||
<span style="width:auto;line-height: 5px;" onClick="(evt)=>this.happend(evt);return false;">Mock</span>
|
<span style="width:auto;line-height: 5px;" onClick="(evt)=>this.happend(evt);return false;">Mock</span>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user