ファイル名自体は「index.php」で使用しております。
gulp-html-beautifyを走らせると例で下記のようなコードに状態になっております。
これを縦に綺麗に並べたいのですが、同じ階層にあっても段々になってしまいます。
色々オプション試してのですが上手くいきませんでした。
gulp-html-beautifyという名前だけあって、phpのインデントは無理でしょうか…
どなたか、ご教示お願いいたします…。
参考サイト
https://dezanari.com/gulp-html-beautify/
php
1 <tr> 2 <th>「〜」は仮</th> 3 <td<?php ~ ?>><?php ~ ?></td> 4 <td<?php ~ ?>><?php ~ ?></td> 5 <td<?php ~ ?>><?php ~ ?></td> 6 <td<?php ~ ?>><?php ~ ?></td> 7 </tr>
使用しているオプションはコチラです。
js
1var gulp = require('gulp'); 2var htmlbeautify = require('gulp-html-beautify'); 3 4gulp.task('htmlbeautify', function(done) { 5 var options = { 6 // <head>と<body>をインデントする 7 "indent_inner_html": true, 8 // タブでインデントする。falseならスペースでインデント 9 "indent_with_tabs": false, 10 // インデント幅 11 "indent_size": 2, 12 }; 13 gulp.src('./dest/*/index.+(html|php)') 14 .pipe(htmlbeautify(options)) 15 .pipe(gulp.dest('./dest/')); 16 done(); 17});
あなたの回答
tips
プレビュー