Author Topic: HTML beautification problems  (Read 150 times)

guth

  • Community Member
  • Posts: 39
  • Hero Points: 2
HTML beautification problems
« on: September 13, 2017, 10:07:46 am »
HI,

I'm doing some Vue.js development and am writing js inside script tags in a HTML file.

Say the file looks like below. If I place the cursor on "vm =" line and press TAB nothing happens, but if I select the script tag and its contents and then select beautification, then everything inside the script tags get indented, which I expected from the tabing.
<html>
<head>
    <script src="https://unpkg.com/vue"></script>
</head>
<body>
<div id="app">
    <text v-model="greeting"></text>
</div>
</body>
<script>
vm = new Vue({

});
</script>
</html>


Further, say that the script tag now looks like below, and then after "data:" one presses { to start writing some vue variables, then the line above gets misaligned.

<script>
vm = new Vue({
   el: "#app",
   data:
});
</script>

The script tag ends up in:

vm = new Vue({
el: "#app",
      data: {
   }
});


If now selecting the script tag and its contents and selecting beautification, it ends up with:

<script>
   vm = new Vue({
      el: "#app",
      data: {
      }
   });
</script>


which is much nicer!

guth

  • Community Member
  • Posts: 39
  • Hero Points: 2
Re: HTML beautification problems
« Reply #1 on: September 13, 2017, 10:09:24 am »
Forgot to add that when selecting the script tag and its contents, and running beautify, then a line is added above the start script tag.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 768
  • Hero Points: 39
Re: HTML beautification problems
« Reply #2 on: September 13, 2017, 01:25:12 pm »
I can reproduce the editing problem with tab.  Not the brace one.  Can you post the user.cfg.xml file from your config directory so I can compare our settings?  I'm guessing a difference in our settings is why I don't get that behavior adding the '{'.

guth

  • Community Member
  • Posts: 39
  • Hero Points: 2
Re: HTML beautification problems
« Reply #3 on: September 14, 2017, 05:42:27 am »
How do I send you the user.cfg.xml file?

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 3837
  • Hero Points: 250
Re: HTML beautification problems
« Reply #4 on: September 14, 2017, 01:13:32 pm »
You can post it here. It's always pretty small.

guth

  • Community Member
  • Posts: 39
  • Hero Points: 2
Re: HTML beautification problems
« Reply #5 on: September 14, 2017, 01:45:41 pm »
Mine is 250 KB so I can't do that.

SlickEdit Support

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 251
  • Hero Points: 23
Re: HTML beautification problems
« Reply #6 on: September 14, 2017, 02:02:28 pm »
You can add the file as an attachment to your post.

SlickEdit Support

guth

  • Community Member
  • Posts: 39
  • Hero Points: 2
Re: HTML beautification problems
« Reply #7 on: September 14, 2017, 02:18:59 pm »
I first tried to send a PM to patrick, but didn't find any attachment function.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 768
  • Hero Points: 39
Re: HTML beautification problems
« Reply #8 on: September 15, 2017, 04:20:24 pm »
Got it, thanks.  I'll take a look at it.