You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When templating is set to php, and a php tag immediately follows a script tag, then the javascript inside the block will fail to format. Placing a comment or any other js expression before the php tag will cause it to format correctly.
var format = require('js-beautify');
var fs = require('fs');
var src = fs.readFileSync('./test.php').toString();
fs.writeFileSync('./formatted.php', format.html(src, { js: { templating: ['php'] } }));
Environment
OS: Linux
The text was updated successfully, but these errors were encountered:
bmewburn
changed the title
If a php tag follows a script tag then the following javascript will fail to format
If a php tag follows a script tag then javascript will fail to format
Jul 12, 2019
bitwiseman
changed the title
If a php tag follows a script tag then javascript will fail to format
javascript will fails to format when <?php > is first text inside <script> tag
Jul 16, 2019
bitwiseman
changed the title
javascript will fails to format when <?php > is first text inside <script> tag
javascript fails to format when <?php > is first text inside <script> tag
Jul 16, 2019
Description
When templating is set to php, and a php tag immediately follows a script tag, then the javascript inside the block will fail to format. Placing a comment or any other js expression before the php tag will cause it to format correctly.
Input
The code looked like this before beautification:
Actual Output
The code actually looked like this after beautification:
Steps to Reproduce
Environment
OS: Linux
The text was updated successfully, but these errors were encountered: