diff --git a/js/test/generated/beautify-html-tests.js b/js/test/generated/beautify-html-tests.js index ada652e37..6ea8e84fd 100644 --- a/js/test/generated/beautify-html-tests.js +++ b/js/test/generated/beautify-html-tests.js @@ -658,6 +658,61 @@ function run_html_tests(test_obj, Urlencoded, js_beautify, html_beautify, css_be test_fragment('
'); test_fragment('
'); + // Handlebars Indenting On - (content = "{{!-- \n mult-line\ncomment \n{{#> component}}\n mult-line\ncomment \n with spacing\n {{/ component}}--}}") + opts.indent_handlebars = true; + test_fragment('{{page-title}}'); + test_fragment('{{#if 0}}{{/if}}'); + test_fragment('{{#if 0}}{{!-- \n mult-line\ncomment \n{{#> component}}\n mult-line\ncomment \n with spacing\n {{/ component}}--}}{{/if}}'); + test_fragment('{{#if 0}}\n{{/if}}'); + test_fragment( + '{{#if words}}{{/if}}', + '{{#if words}}{{/if}}'); + test_fragment( + '{{#if words}}{{!-- \n mult-line\ncomment \n{{#> component}}\n mult-line\ncomment \n with spacing\n {{/ component}}--}}{{/if}}', + '{{#if words}}{{!-- \n mult-line\ncomment \n{{#> component}}\n mult-line\ncomment \n with spacing\n {{/ component}}--}}{{/if}}'); + test_fragment( + '{{#if words}}{{!-- \n mult-line\ncomment \n{{#> component}}\n mult-line\ncomment \n with spacing\n {{/ component}}--}}{{/if}}', + '{{#if words}}{{!-- \n mult-line\ncomment \n{{#> component}}\n mult-line\ncomment \n with spacing\n {{/ component}}--}}{{/if}}'); + test_fragment('{{#if 1}}\n
\n
\n{{/if}}'); + test_fragment( + '{{#if 1}}\n
\n
\n{{/if}}', + '{{#if 1}}\n
\n
\n{{/if}}'); + test_fragment('
\n {{#if 1}}\n {{/if}}\n
'); + test_fragment( + '
\n{{#if 1}}\n{{/if}}\n
', + '
\n {{#if 1}}\n {{/if}}\n
'); + test_fragment( + '{{#if}}\n{{#each}}\n{{#if}}\n{{!-- \n mult-line\ncomment \n{{#> component}}\n mult-line\ncomment \n with spacing\n {{/ component}}--}}\n{{/if}}\n{{#if}}\n{{!-- \n mult-line\ncomment \n{{#> component}}\n mult-line\ncomment \n with spacing\n {{/ component}}--}}\n{{/if}}\n{{/each}}\n{{/if}}', + '{{#if}}\n {{#each}}\n {{#if}}\n {{!-- \n mult-line\ncomment \n{{#> component}}\n mult-line\ncomment \n with spacing\n {{/ component}}--}}\n {{/if}}\n {{#if}}\n {{!-- \n mult-line\ncomment \n{{#> component}}\n mult-line\ncomment \n with spacing\n {{/ component}}--}}\n {{/if}}\n {{/each}}\n{{/if}}'); + test_fragment('{{#if 1}}\n
\n
\n{{/if}}'); + test_fragment( + '{{#if 1}}\n {{!-- \n mult-line\ncomment \n{{#> component}}\n mult-line\ncomment \n with spacing\n {{/ component}}--}}\n {{else}}\n {{!-- \n mult-line\ncomment \n{{#> component}}\n mult-line\ncomment \n with spacing\n {{/ component}}--}}\n{{/if}}', + '{{#if 1}}\n {{!-- \n mult-line\ncomment \n{{#> component}}\n mult-line\ncomment \n with spacing\n {{/ component}}--}}\n{{else}}\n {{!-- \n mult-line\ncomment \n{{#> component}}\n mult-line\ncomment \n with spacing\n {{/ component}}--}}\n{{/if}}'); + test_fragment( + '{{#if 1}}\n {{else}}\n {{/if}}', + '{{#if 1}}\n{{else}}\n{{/if}}'); + test_fragment( + '{{#if thing}}\n{{#if otherthing}}\n {{!-- \n mult-line\ncomment \n{{#> component}}\n mult-line\ncomment \n with spacing\n {{/ component}}--}}\n {{else}}\n{{!-- \n mult-line\ncomment \n{{#> component}}\n mult-line\ncomment \n with spacing\n {{/ component}}--}}\n {{/if}}\n {{else}}\n{{!-- \n mult-line\ncomment \n{{#> component}}\n mult-line\ncomment \n with spacing\n {{/ component}}--}}\n{{/if}}', + '{{#if thing}}\n {{#if otherthing}}\n {{!-- \n mult-line\ncomment \n{{#> component}}\n mult-line\ncomment \n with spacing\n {{/ component}}--}}\n {{else}}\n {{!-- \n mult-line\ncomment \n{{#> component}}\n mult-line\ncomment \n with spacing\n {{/ component}}--}}\n {{/if}}\n{{else}}\n {{!-- \n mult-line\ncomment \n{{#> component}}\n mult-line\ncomment \n with spacing\n {{/ component}}--}}\n{{/if}}'); + test_fragment( + '', + '
'); + test_fragment( + '{{!-- \n mult-line\ncomment \n{{#> component}}\n mult-line\ncomment \n with spacing\n {{/ component}}--}}', + '
{{!-- \n mult-line\ncomment \n{{#> component}}\n mult-line\ncomment \n with spacing\n {{/ component}}--}}
'); + test_fragment( + '{{!-- \n mult-line\ncomment \n{{#> component}}\n mult-line\ncomment \n with spacing\n {{/ component}}--}}', + '
{{!-- \n mult-line\ncomment \n{{#> component}}\n mult-line\ncomment \n with spacing\n {{/ component}}--}}
'); + test_fragment( + '{{!-- \n mult-line\ncomment \n{{#> component}}\n mult-line\ncomment \n with spacing\n {{/ component}}--}}', + '{{!-- \n mult-line\ncomment \n{{#> component}}\n mult-line\ncomment \n with spacing\n {{/ component}}--}}'); + test_fragment('
{{!-- \n mult-line\ncomment \n{{#> component}}\n mult-line\ncomment \n with spacing\n {{/ component}}--}}
'); + test_fragment('
{{!-- \n mult-line\ncomment \n{{#> component}}\n mult-line\ncomment \n with spacing\n {{/ component}}--}}
'); + test_fragment('
'); + test_fragment('
'); + test_fragment('
'); + test_fragment('
'); + reset_options(); //============================================================ diff --git a/test/data/html/tests.js b/test/data/html/tests.js index 00028eda0..4212f7352 100644 --- a/test/data/html/tests.js +++ b/test/data/html/tests.js @@ -386,6 +386,11 @@ exports.test_data = { { name: "indent_handlebars", value: "true" } ], content: '{{!-- \\n mult-line\\ncomment \\n with spacing\\n--}}' + }, { + options: [ + { name: "indent_handlebars", value: "true" } + ], + content: '{{!-- \\n mult-line\\ncomment \\n{{#> component}}\\n mult-line\\ncomment \\n with spacing\\n {{/ component}}--}}' }], tests: [ { fragment: true, unchanged: '{{page-title}}' },