Skip to content

Commit

Permalink
fix: 🐛 revert unnecessary commit
Browse files Browse the repository at this point in the history
  • Loading branch information
shufo committed Jul 18, 2020
1 parent b95f577 commit 5a18712
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,27 +72,20 @@ export function generateDiff(path, originalLines, formattedLines) {

export function prettifyPhpContentWithUnescapedTags(content) {
let prettified = _.replace(content, /\{\{--/g, '<?php //');
prettified = _.replace(prettified, /<\?=/g, '<?php/*short*/');
prettified = _.replace(prettified, /\?>/g, '/*close*/?>');
// prettified = _.replace(prettified, /\?>/g, '/*close*/ ?>');
// prettified = _.replace(prettified, /\?>/g, '/*close*/ ?>');
prettified = _.replace(prettified, /--\}\}/g, '// ?>');
prettified = _.replace(prettified, /\{\{/g, '<?php ');
prettified = _.replace(prettified, /\}\}/g, ' ?>');

prettified = prettier.format(prettified, {
parser: 'php',
phpVersion: '7.4',
printWidth: 1000,
singleQuote: true,
});
console.log(prettified);

prettified = _.replace(prettified, /<\?php\s\/\//g, '{{--');
prettified = _.replace(prettified, /\/\/\s\?>/g, '--}}');
prettified = _.replace(prettified, /<\?php\s/g, '{{ ');
prettified = _.replace(prettified, /\s\?>/g, ' }}');
// prettified = _.replace(prettified, /<\?php\/\*short\*\//g, '<?=');
// prettified = _.replace(prettified, /\/\*close\*\/\?>/g, '?>');

return prettified;
}
Expand All @@ -103,7 +96,6 @@ export function prettifyPhpContentWithEscapedTags(content) {

prettified = prettier.format(prettified, {
parser: 'php',
phpVersion: '7.4',
printWidth: 1000,
singleQuote: true,
});
Expand Down

0 comments on commit 5a18712

Please sign in to comment.