Author Topic: HTML5 coloring and formatting  (Read 2750 times)

Marcel

  • Senior Community Member
  • Posts: 261
  • Hero Points: 26
HTML5 coloring and formatting
« on: October 04, 2017, 08:44:32 PM »
I am having difficulties getting SE to color and beautify (all settings default) the attached HTML5 fragment. It doesn't color elements like [<div>, <ul>, <li>, <p>] etc, and also doesn't indent them underneath <aside>.  Is there a tag list somewhere that needs to be updated?

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6823
  • Hero Points: 526
Re: HTML5 coloring and formatting
« Reply #1 on: October 05, 2017, 02:29:22 AM »
Color coding looks ok to me. Attached is picture of the color coding I'm seeing for your sample with a default config.

It does look like the default html beautifier profile setting for aside isn't correct. It's Parent Tag setting is "(inline)". Try changing it to "(indented block)" (Tools>Options>Languages>Web Authoring Languages>HTML>Formatting>Click Edit... button, Click on Tags Tab, select the "aside" tag.

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2896
  • Hero Points: 153
Re: HTML5 coloring and formatting
« Reply #2 on: October 05, 2017, 01:48:04 PM »
Could the mode for the file be wrong?

Marcel

  • Senior Community Member
  • Posts: 261
  • Hero Points: 26
Re: HTML5 coloring and formatting
« Reply #3 on: October 05, 2017, 01:59:16 PM »
Thanks Clark, changing the <aside> declaration worked.

Another question: Frameworks nowadays have hyphenated tags, e.g. <order-processor>. The word definition for HTML does not include the hyphen, so Alt-W only selects 'order'.  I tried to change the character set in HTML general, but that did seem to alter the behavior.

Marcel

  • Senior Community Member
  • Posts: 261
  • Hero Points: 26
Re: HTML5 coloring and formatting
« Reply #4 on: October 05, 2017, 02:02:39 PM »
@Dan: Sorry, I didn't see your question. No, the file mode is HTML.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6823
  • Hero Points: 526
Re: HTML5 coloring and formatting
« Reply #5 on: October 05, 2017, 02:25:04 PM »
There's a trick for adding "-" to your word chars. You need to prefix it with backslash (i.e append "\-"). "-" has an additional regular expression meaning. The word chars are thrown into regex brackets everywhere.