notepad2-mod icon indicating copy to clipboard operation
notepad2-mod copied to clipboard

XML/HTML tags match

Open XhmikosR opened this issue 13 years ago • 6 comments

This is Issue 27 moved from a Google Code project. Added by 2011-05-16T10:16:06.000Z by [email protected]. Please review that bug for more context and additional comments, but update this bug.

Original labels: Type-Enhancement, Priority-Medium

Original description

Feature request - the same as brace highlight/match but for XML tags. For example when the cursor is over a <tag> then highlight </tag>

This should support two types of XML/HTML tags closing:
1 . <tag attr=&quot;val&quot;>blahblah</tag>
2. <tag attr=&quot;val&quot; />

XhmikosR avatar Aug 27 '12 09:08 XhmikosR

I would love to see this added as well. Pretty much the only thing I've been missing so far.

ltguillaume avatar Jun 22 '13 19:06 ltguillaume

Brace matching is handled by Scintilla. This would have to be sent upstream to be implemented, wouldn't it? SciTE doesn't seem to match HTML elements either (unless I'm missing something?).

QWp6t avatar Jun 22 '13 22:06 QWp6t

Notepad++ uses Scintilla and supports this fully.

ltguillaume avatar Jul 07 '14 17:07 ltguillaume

This might help: http://sourceforge.net/projects/npp-plugins/files/HTMLTag/ It does - for Notepad++ - exactly what has been requested here. To my knowledge it has already been included since, without the use of this plugin, but this code is isolated, should make it easier to go through.

ltguillaume avatar Aug 13 '14 12:08 ltguillaume

@ltGuillaume: that's Pascal not C.

XhmikosR avatar Aug 13 '14 14:08 XhmikosR

Well that was stupid, didn't even bother to check :/ Sorry.

The Notepad++ C code can be found inside these two files: /PowerEditor/src/ScitillaComponent/xmlMatchedTagsHighlighter.cpp and /PowerEditor/src/ScitillaComponent/xmlMatchedTagsHighlighter.h

Source download: http://notepad-plus-plus.org/download/

ltguillaume avatar Aug 13 '14 15:08 ltguillaume