Komodo / KomodoEdit

Komodo Edit is a fast and free multi-language code editor. Written in JS, Python, C++ and based on the Mozilla platform.
http://www.komodoide.com/komodo-edit
Other
2.15k stars 301 forks source link

HTML folding for lowercase <dl> not working (except for lowest level elements) #3864

Open mjross opened 4 years ago

mjross commented 4 years ago

Summary

In HTML files, "DL" elements (e.g., <DL>) that have child "DL" elements nested within them, will only respond correctly to the folding/unfolding (collapse/expand) mouse click commands if the element name "DL" is uppercase, but not if it is lowercase, which violates the fundamental HTML syntax that the element names of open tags and self-closing tags should be case insensitive.

Steps to Reproduce

Help > Troubleshooting > Restart in Safe-Mode. Consider a simple test HTML file, such as the example provided here, which contains "DL" elements that have child "DL" elements nested within them:

<!DOCTYPE html>
<TITLE>Bookmarks</TITLE>
<H1>Bookmarks</H1>
<DL>
    <DT><H3>dt 1</H3></DT>
    <DL>
        <DT><H3>dt 1.1</H3></DT>
        <DL>
            <DT><A HREF="http://www.example.com/">dt 1.1.1</A></DT>
        </DL>
        <DT><H3>dt 1.2</H3></DT>
        <DL>
            <DT><A HREF="http://www.example.com/">dt 1.2.1</A></DT>
        </DL>
    </DL>
    <DT><H3>dt 2</H3></DT>
    <DL>
        <DT><H3>dt 2.1</H3></DT>
        <DL>
            <DT><A HREF="http://www.example.com/">dt 2.1.1</A></DT>
        </DL>
        <DT><H3>dt 2.2</H3></DT>
        <DL>
            <DT><A HREF="http://www.example.com/">dt 2.2.1</A></DT>
        </DL>
    </DL>
</DL>

In this first case, the element names are all uppercase. We can use the mouse pointer to click on any one of the fold/unfold icons in order to fold into that line all of the indented lines below it. (I'm not sure what the proper name is for those small white boxes that contain a horizontal line bisecting each one.) For instance, if we click on the icon for line number 6, the lines of HTML indented under it are folded away correctly:

image

But if the element name is lowercase (i.e., <dl>), it does not work correctly and only folds the immediate next line but none of the remaining ones that should have been folded away:

image

This is true for all of the "dl" elements except for the one at the very lowest level -- on line 8 in this example.

Note that one of the most common examples of such files are browser bookmarks. In fact, that's how I stumbled upon this problem, when converting my bookmarks.html file from using uppercase element names to lowercase, at which point the code folding stop working properly.

Platform Information

Komodo IDE 11.1.1 build 91089 (on Windows Home 10.0.18363.778)

th3coop commented 4 years ago

Thanks for filing, @mjross.

mjross commented 4 years ago

No problem, @th3coop, and I hope everyone in your family and the Komodo community are doing well during this pandemic.

th3coop commented 4 years ago

Same to you @mjross. Stay safe and healthy, please and thank you!