Community
    • Login

    collapse everything except <h1>

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    2 Posts 2 Posters 2.4k Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Paweł ŁabnoP Offline
      Paweł Łabno
      last edited by

      i’m writing a very long text in html.after a while it is difficult to find a part i’d like to edit. it would be nice to collapse all text except h1 titles. is there any way to do this?

      1 Reply Last reply Reply Quote 0
      • guy038G Offline
        guy038
        last edited by

        Hello, @paweł-łabno and All,

        Not totally sure that is the right solution for you ! But let’s give it a try ;-)). I simply suppose that all your titles lay in a single line. So :

        • Open one of your html files, in N++

        • Fold all the sections with the View > Fold All menu option or use the Alt + 0 shortcut ( NOT from the numeric keypad ! )

        => The text collapses and you should see the <html> tag, only !

        • Then, open the Find dialog Search > Find… menu option or use the Ctrl + F shortcut

        • Type in the regex (?-is)(?<=<h1>).*?(?=</h1>) , in the Find what: zone

        • Select the Regular expression search mode

        • Click on the Find All in Current Document button

        => At once, the Find result windows pops up, at bottom of the screen, with all the <h1>....</h1> titles !

        • Now, simply double-click, in the Find result window, on one of these results. Immediately :

          • Your HTML file should expand the zone, containing the corresponding <h1>....</h1> title ;-))

          • All the title, between the boundaries <h1> and </h1>, is selected

        Best Regards

        guy038

        1 Reply Last reply Reply Quote 0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • First post
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors