Vue template processing: How to remove trailing spaces between text node and closing tag

Viewed 444

In my vue-cli project i have many .vue files with tags that have trailing spaces between text node and closing tag. I need that trailing spaces (or tabs, or line breaks).

What i have in my template:

<RouterLink
  :to="{name: 'vacancy', params: { id: vacancy.id }}"
  class="vacancy-name-link"
>
  {{ vacancy.title }}
</RouterLink>

What i want:

<a href="/vacancy/0">Vacancy title</a>

What i have:

<a href="/vacancy/0"> Vacancy title </a>

Why i can't write code in one-line:

  1. there is a rule in eslint vue/multiline-html-element-content-newline
  2. in a project i have many files (more than 500) with that issue with many different tags (e.g. <span>, <a> etc.)

Is there any method to update rendered template to trim trailing spaces inside tags?

Sorry for my english.

0 Answers
Related