Author Topic: HTML beautification problems  (Read 3279 times)

guth

  • Senior Community Member
  • Posts: 104
  • Hero Points: 7
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

  • Senior Community Member
  • Posts: 104
  • Hero Points: 7
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: 1818
  • Hero Points: 151
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

  • Senior Community Member
  • Posts: 104
  • Hero Points: 7
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: 6823
  • Hero Points: 526
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

  • Senior Community Member
  • Posts: 104
  • Hero Points: 7
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: 384
  • Hero Points: 29
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

  • Senior Community Member
  • Posts: 104
  • Hero Points: 7
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: 1818
  • Hero Points: 151
Re: HTML beautification problems
« Reply #8 on: September 15, 2017, 04:20:24 PM »
Got it, thanks.  I'll take a look at it.