Open jawshooah opened 9 years ago
Supporting this properly would be a big undertaking. Making it behave better might be possible without fully supporting it. This is lower priority than a number of other tasks for me. PR's welcome.
It seems to be possible https://github.com/beautify-web/js-beautify/blob/master/js/lib/beautify-html.js#L103
var token_type = multi_parser.token_type;
if (multi_parser.token_text.substr(0, 2) === '<%') {
token_type = '';
}
switch (token_type) {
Seen this issue has been open for about 9 years. Commenting to express need for this feature.
My software uses EJS templates to generate text content for ES, CSS, and Markup Template Language (EJS) files. EJS generates text content then JS Beautify formats it then Node FS writes the file content.
I noticed that BeautifyJS supports some markup template languages (ERB, for example, which closely resembles EJS) through an optional templating
configuration property.
It would be awesome if js-beautify supported EJS templates out of the box. Currently the following code...
...is transformed into: