diff --git a/autotests/folding/test.htm.fold b/autotests/folding/test.htm.fold --- a/autotests/folding/test.htm.fold +++ b/autotests/folding/test.htm.fold @@ -11,7 +11,53 @@

Hello, {{ name }}!

+ + > document.body.appendChild(document.createTextNode('Hello World!')); // comment > + + + type="text/typescript"> + class Student { + fullName: string; + constructor(public firstName: string, public middleInitial: string, public lastName: string) { + this.fullName = firstName + " " + middleInitial + " " + lastName; + } + } + let a: null = null; + let b: number = 12___3; + > + + + src="https://unpkg.com/babel-standalone@6/babel.min.js">> + type="text/babel"> + ReactDOM.render( + >Hello, world!>, + document.getElementById('root') + ); + function Story(props) { + const SpecificStory = components[props.storyType]; + return story={ props.story } attr2="&ref;" attr3="Hello\n" />; + } + > + + + type="x-tmpl-mustache"> + {{#movie}} + > + >{{title}}> + src="{{poster}}" alt="{{title}}"/> + > + > + Rating - {{ratings.critics_rating}} + > + {{/movie}} + {{^movie}} + > + Movie Does Not Exist :( + > + {{/movie}} + {{! comment }} + > diff --git a/autotests/folding/test.markdown.fold b/autotests/folding/test.markdown.fold --- a/autotests/folding/test.markdown.fold +++ b/autotests/folding/test.markdown.fold @@ -55,7 +55,7 @@ ## Python ```python -def addXToY(x, y): +def addXToY(x, y): total = x + y print total ``` diff --git a/autotests/html/test.htm.html b/autotests/html/test.htm.html --- a/autotests/html/test.htm.html +++ b/autotests/html/test.htm.html @@ -17,8 +17,54 @@ <body class="ui main"> <p *ngFor="let name of names">Hello, {{ name }}!</p> </body> + + <!-- JavaScript code --> <script> document.body.appendChild(document.createTextNode('Hello World!')); // comment </script> + + <!-- TypeScript code --> + <script type="text/typescript"> + class Student { + fullName: string; + constructor(public firstName: string, public middleInitial: string, public lastName: string) { + this.fullName = firstName + " " + middleInitial + " " + lastName; + } + } + let a: null = null; + let b: number = 12___3; + </script> + + <!-- JSX code --> + <script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script> + <script type="text/babel"> + ReactDOM.render( + <h1>Hello, world!</h1>, + document.getElementById('root') + ); + function Story(props) { + const SpecificStory = components[props.storyType]; + return <SpecificStory story={ props.story } attr2="&ref;" attr3="Hello\n" />; + } + </script> + + <!-- MustacheJS --> + <script type="x-tmpl-mustache"> + {{#movie}} + <div> + <h1>{{title}}</h1> + <img src="{{poster}}" alt="{{title}}"/> + </div> + <div> + Rating - {{ratings.critics_rating}} + </div> + {{/movie}} + {{^movie}} + <div> + Movie Does Not Exist :( + </div> + {{/movie}} + {{! comment }} + </script> </html> diff --git a/autotests/input/test.htm b/autotests/input/test.htm --- a/autotests/input/test.htm +++ b/autotests/input/test.htm @@ -11,7 +11,53 @@

Hello, {{ name }}!

+ + + + + + + + + + + + diff --git a/autotests/reference/test.htm.ref b/autotests/reference/test.htm.ref --- a/autotests/reference/test.htm.ref +++ b/autotests/reference/test.htm.ref @@ -11,7 +11,53 @@ class="ui main">
*ngFor="let name of names">Hello, {{ name }}!



+
+

+
+
+ type="text/typescript">
+ class Student {
+ fullName: string;
+ constructor(public firstName: string, public middleInitial: string, public lastName: string) {
+ this.fullName = firstName + " " + middleInitial + " " + lastName;
+ }
+ }
+ let a: null = null;
+ let b: number = 12___3;
+
+
+
+ src="https://unpkg.com/babel-standalone@6/babel.min.js">
+ type="text/babel">
+ ReactDOM.render(
+

Hello, world!

,
+ document.getElementById('root')
+ );
+ function Story(props) {
+ const SpecificStory = components[props.storyType];
+ return story={ props.story } attr2="&ref;" attr3="Hello\n" />;
+ }
+
+
+
+ type="x-tmpl-mustache">
+ {{#movie}}
+

+

{{title}}


+ src="{{poster}}" alt="{{title}}"/>
+

+

+ Rating - {{ratings.critics_rating}}
+

+ {{/movie}}
+ {{^movie}}
+

+ Movie Does Not Exist :(
+

+ {{/movie}}
+ {{! comment }}
+

diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt --- a/data/CMakeLists.txt +++ b/data/CMakeLists.txt @@ -9,14 +9,20 @@ generate_php_syntax_definition(javascript-php.xml javascript.xml) generate_php_syntax_definition(css-php.xml css.xml) generate_php_syntax_definition(html-php.xml html.xml) +generate_php_syntax_definition(javascript-react-php.xml javascript-react.xml) +generate_php_syntax_definition(typescript-php.xml typescript.xml) +generate_php_syntax_definition(mustache-js-php.xml mustache-js.xml) # find all definitions file(GLOB src_defs "${CMAKE_CURRENT_SOURCE_DIR}/syntax/*.xml") set(defs ${src_defs} ${CMAKE_CURRENT_BINARY_DIR}/syntax/html-php.xml ${CMAKE_CURRENT_BINARY_DIR}/syntax/css-php.xml ${CMAKE_CURRENT_BINARY_DIR}/syntax/javascript-php.xml + ${CMAKE_CURRENT_BINARY_DIR}/syntax/javascript-react-php.xml + ${CMAKE_CURRENT_BINARY_DIR}/syntax/typescript-php.xml + ${CMAKE_CURRENT_BINARY_DIR}/syntax/mustache-js-php.xml ) # theme data resource diff --git a/data/generators/generate-php.pl b/data/generators/generate-php.pl --- a/data/generators/generate-php.pl +++ b/data/generators/generate-php.pl @@ -42,16 +42,24 @@ } else { - $file =~ s/]+)name="([^"]*)"/