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

How to clean HTML code from extra spaces? #10281

Closed
afuno opened this issue Jul 16, 2019 · 6 comments
Closed

How to clean HTML code from extra spaces? #10281

afuno opened this issue Jul 16, 2019 · 6 comments

Comments

@afuno
Copy link

afuno commented Jul 16, 2019

Version

2.6.10

Reproduction link

https://jsfiddle.net/chrLg4uk/

Steps to reproduce

  1. Write a simple component that I attached.
  2. In the HTML code you will see that there are spaces before and after the text.

What is expected?

I want to remove these spaces. I can not imagine how you can write an HTML tag and a variable on one line. Especially when a lot of classes and other attributes.

What is actually happening?

Cannot remove extra spaces. Need to write a variable on a single line with an HTML tag.

@posva
Copy link
Member

posva commented Jul 16, 2019

You probably want to write <span>{{ message }}</span>


Remember you can use the forum or the Discord chat to ask quick questions!

@posva posva closed this as completed Jul 16, 2019
@afuno
Copy link
Author

afuno commented Jul 16, 2019

@posva That is, I need to wrap all the variables?

@posva
Copy link
Member

posva commented Jul 16, 2019

If you don't want extra space, yes, that's how HTML work:

<span>Some text</span>

is different from

<span>
  Some Text
</span>

@afuno
Copy link
Author

afuno commented Jul 16, 2019

@posva Your way works. Thank.

@afuno
Copy link
Author

afuno commented Jul 16, 2019

@posva This problem can also be solved, for example, by going to pug?

@posva
Copy link
Member

posva commented Jul 16, 2019

You could, I wouldn't use pug personally. Anyway, please ask questions in the forum or chats 🙂

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

No branches or pull requests

2 participants