Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When building html tags using Mustache variables, extra whitespace is added after opening arrow #1602

Closed
leeroyrose opened this issue Dec 14, 2018 · 4 comments

Comments

@leeroyrose
Copy link

Description

White space is being added when building html tags out of mustache variables.

Input

The code looked like this before beautification:

<{{tag}}>{{text}}</{{tag}}>

Current Output

The code actually looked like this after beautification:

< {{tag}}>{{text}}</ {{tag}}>

Expected Output

The code should have looked like this after beautification:

<{{tag}}>{{text}}</{{tag}}>

Environment

Browser User Agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3640.0 Safari/537.36

Language Selected:
HTML

Settings

Example:

{
  "indent_size": "1",
  "indent_char": "\t",
  "max_preserve_newlines": "-1",
  "preserve_newlines": false,
  "keep_array_indentation": true,
  "break_chained_methods": true,
  "indent_scripts": "keep",
  "brace_style": "none",
  "space_before_conditional": true,
  "unescape_strings": true,
  "jslint_happy": true,
  "end_with_newline": true,
  "wrap_line_length": "0",
  "indent_inner_html": true,
  "comma_first": true,
  "e4x": true
}
@bitwiseman
Copy link
Member

@leeroyrose Take a look at 1.9.0-beta2 now up on https://beautifier.io .

@bitwiseman bitwiseman modified the milestones: v1.9.x, v1.9.0 Feb 27, 2019
@leeroyrose
Copy link
Author

leeroyrose commented Apr 29, 2019

Hey @bitwiseman

Sorry for the immensely late reply, i've just got round to looking at this again but testing it on v1.9.1 now breaks it onto 9 lines:

< {
	{
		tag
	}
} > {
	{
		text
	}
} < /{{tag}}>

I don't think the change implemented resolved the issue.

@bitwiseman
Copy link
Member

@leeroyrose
Hey, thanks! (I updated your text above to use triple-backtick.)

Where are you testing this? What you have above is the same as what I get when I run html through the JavaScript beautifier.

@leeroyrose
Copy link
Author

Hey @bitwiseman

Ah thank you, it looks much better now. I'm testing it on the online Javascript Beautifier. But I realised I hadn't switched it over to html, I had it set to CSS. My bad, sorry about that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants