HTML on a single line -- how to wrap and show syntax with pretty indents?



  • Hi, there, I am a new user to Notepad+ and not a programmer.

    I have copied a gigantic chunk of html code from Google Docs into a Notepad+ file and given it an .html file extension. (I have removed the script tag at the end). My problem is that the entire HTML is all on a single line of 350,000 characters, and my goal is to be able to show it in typical indented style with normal width.

    I should also mention that this chunk of HTML is mostly tabular data. Notepad + recognizes the language as HTML.

    If I select wordwrap, I do get a wall of code spread out over multiple lines that for all purposes is unreadable. If I select Indent, it does nothing. EOL settings is set to Windows.

    I know this is not right, but I don’t know what functions I need to invoke here. I don’t even know how to describe the functionality which I need – only that some text editors seem to do it automatically. Do I need to rely on some Notepad+ plugin to do this? Thanks for your help.



  • @Robert-Nagle

    Have you tried to search the web for “notepad++ html plugin”?



  • Jim Dailey, yes, I actually did that and found nothing helpful. I did already browse through the list NPP plugins and didn’t see one that seemed to come close to answering the question.

    I had already imported two plugins: HTMLTag_plugin and xmltools, but they were not appearing; I now see that I needed to put the dlls in the Program Files directory. (This is strange; I remember that there was some Plugin Manager ; oh yes – (apparently there was https://ccm.net/faq/32347-how-to-install-xml-plugins-in-notepad).

    Instructions for importing plugins are here: http://docs.notepad-plus-plus.org/index.php/Plugin_Central

    But I’m not seeing anything. Aha, it looks like I have the 64 bit N++ and the plugins are all 32 bit. Should I be using the 32 bit version to get all that fancy plugin magic? Do you agree? thanks.



  • @Robert-Nagle

    Plugin DLLs technically go into the plugins folder if you are putting them there manually. Or use the Plugin Manager but that has complications these days…

    If you can find 64-bit versions of the plugins you want to use, stick with 64-bit Notepad++…otherwise go with 32-bit Notepad++. Just note that you can’t mismatch 64-bit EXEs and 32-bit DLLs (or vice-versa) but it seems you already know that…



  • @Robert-Nagle,

    Using the following original,

    <html><body><p>one</p><p>two</p><ul><li>a</li><li>b<ol><li>alpha</li><li>beta</li></ol></li></ul></body></html>
    

    I ran Plugins > XML Tools > Pretty Print (XLM only - with line breaks), and got

    <html>
        <body>
            <p>one</p>
            <p>two</p>
            <ul>
                <li>a</li>
                <li>b<ol>
                        <li>alpha</li>
                        <li>beta</li>
                    </ol>
                </li>
            </ul>
        </body>
    </html>
    

    I think once you have that plugin installed properly, it should do what you want.



  • And XML Tools does have a 64bit version… so if you don’t have the 64bit Plugin Manager, you can still grab it manually from the 2.4.9 folder, or v2.4.9.2 x64 direct download and put the DLL in your plugins subdirectory



  • Hmm, I reinstalled and used the “Xml Tools 2.4.9.2 x64 Unicode.zip” and am still getting the 32 bit warning. I already reinstalled, but perhaps I need to verify I did everything correctly. Will report back.


Log in to reply