Highlight matching HTML tag

Display customization and font issues

Highlight matching HTML tag

Postby Dalt » Wed May 21, 2008 4:12 am

Hello.
I looked a bit through the manual, couldn't find the one most important thing I'd like to have:
when the cursor is for example somewhere on "<div>", I'd like to see the matching "</div>" colored somehow.
Is there an option to do this ? Thank you.
Dalt
Newbie
 
Posts: 1
Joined: Wed May 21, 2008 4:09 am

Re: Highlight matching HTML tag

Postby Mofi » Wed May 21, 2008 7:37 am

No. UltraEdit is a general text editor not an editor specific written for editing HTML files. If the HTML file is well structured (not everything is on the same line) and you have code folding enabled, you can fold a div block to see where the matching </div> is. You can use HTML Tidy to reformat your HTML file to get a good structure.

If this is still not enough for you and you want the ultimate support as in real HTML editors, you can develop a script which searches for the matching tag. But this script would not be easy. Maybe there is anywhere a JavaScript which is exactly for that job and can be converted to work in UltraEdit.

What works is to use the command Search - Match Brace to highlight everything from <div> to the matching </div>. But only if you have in your syntax highlighting wordfile defined for "HTML":

/Open Brace Strings = "<h1>" "<div>" "<p>"
/Close Brace Strings = ""</h1>" "</div>" "</p>"


But then only <div>...</div> are recognized and not <div class="name">...</div>. Using

/Open Brace Strings = "<h1" "<div" "<p"
/Close Brace Strings = ""</h1>" "</div>" "</p>"


does not work (UE v14.00b) and I don't know why it fails. I have reported this issue to IDM.

With the working <div> </div> brace strings the feature auto-brace matching (syntax highlighting configuration dialog) highlights < of matching <div> or > of matching </div> depending on the cursor position.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 3937
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Highlight matching HTML tag

Postby dpmccabe » Tue Jan 27, 2009 5:13 pm

When editing HTML, is there any way to make UE highlight the matching tag of the one your cursor is currently in? For example, in the screenshot, I clicked on a <p> tag and Notepad++ highlights its closing tag with the same color:

Image

If this isn't possible, could this be included in a future release? It's absolutely invaluable if you need to work with messy HTML or XML, yet only Notepad++, Eclipse, and Visual Studio have this feature, as far as I can tell.

Since I'm editing HTML at least 50% of the time and even running the documents trough TIDY to clean them up isn't enough, it's a feature I can't do without. At this point, it's the only thing keeping me from switching from Notepad++ to a registered version of UE.
dpmccabe
Newbie
 
Posts: 1
Joined: Tue Jan 27, 2009 5:04 pm

Re: Highlight matching HTML tag

Postby Mofi » Wed Jan 28, 2009 3:35 am

See above. Unfortunately I don't see any change in UE v14.20.1.1008 for what I have written in my first post. Maybe more users have to report this issue by email to IDM support to increase the priority for fixing it.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 3937
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Highlight matching HTML tag

Postby kvel » Sat Sep 12, 2009 2:50 am

I'd also like this feature.
kvel
Newbie
 
Posts: 2
Joined: Fri Aug 21, 2009 6:48 am

Re: Highlight matching HTML tag

Postby cars10 » Fri Mar 12, 2010 9:56 am

I was using Notepad++ before my company bought me Ultraedit and this is one of the features I've severely missed!

PLEASE implement it!
cars10
Newbie
 
Posts: 1
Joined: Fri Mar 12, 2010 9:55 am

Re: Highlight matching HTML tag

Postby bambi » Sat Mar 27, 2010 10:35 am

would be a very useful feature!
bambi
Newbie
 
Posts: 1
Joined: Sat Mar 27, 2010 10:33 am

Re: Highlight matching HTML tag

Postby Mofi » Mon Apr 04, 2011 5:28 am

UltraEdit v17.00 has exactly the feature as discussed here and displayed in the image dpmccabe uploaded.

At Advanced - Configuration - Editor Display - Advanced there is the configuration setting Display XML/HTML tag highlighting which is by default enabled. That feature highlights now the entire XML/HTML tag if the caret is inside the opening or closing tag and its matching tag in any file which is syntax highlighted with a wordfile containing the language marker keyword HTML_LANG or XML_LANG in the first line. There is nothing to define in the syntax highlighting wordfile for HTML, XHTML or XML for the XML/HTML tag highlighting feature. This feature can be disabled for those who want the content (tag name, attributes and values) of a tag syntax highlighted during editing a tag instead of highlighting the entire opening and closing tag.

The color used for highlighting the matching tags can be defined at View - Set Colors and has the name Tags.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 3937
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna


Return to Editor Display