Community
    • Login

    Replace characters from certain lines

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    5 Posts 2 Posters 272 Views
    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.
    • MV82M
      MV82
      last edited by MV82

      I want to replace > with >}} from the end of my img tags.

      Now:

      <img src="/images/example-image.png" alt="Example Image" width="244" height="110">
      

      Result:

      {{< img src="/images/example-image.png" alt="Example Image" width="244" height="110" >}}
      

      I want to change this on all pages of my website at once.

      Is it possible? If so, how?

      I already know how to change <img to {{< img. That’s the easy part.

      Alan KilbornA 1 Reply Last reply Reply Quote 1
      • Alan KilbornA
        Alan Kilborn @MV82
        last edited by

        @MV82

        Do both operations at once:

        find: (?-is)<img.*?>
        repl: {{$0}}
        search mode: regular expression

        MV82M 1 Reply Last reply Reply Quote 1
        • MV82M
          MV82 @Alan Kilborn
          last edited by MV82

          @Alan-Kilborn

          Thank you.

          But how do I get the space between {{< and img and between height=“” and >}}?

          Like in the example below:

          {{< img src="/images/example-image.png" alt="Example Image" width="244" height="110" >}}
          

          I don’t know if you know how Hugo (static site generator) works, but for Hugo shortcodes, I need space between {{< and img and between height=“” and >}}.

          Can you please tell me how to do that?

          Alan KilbornA 1 Reply Last reply Reply Quote 1
          • Alan KilbornA
            Alan Kilborn @MV82
            last edited by Alan Kilborn

            @MV82

            find: (?-is)<(img.*?)>
            repl: {{< ${1} >}}

            It might be beneficial for you to learn how this is done, for your future needs, as we don’t continually do this for repeat askers.
            See HERE to get started.

            MV82M 1 Reply Last reply Reply Quote 2
            • MV82M
              MV82 @Alan Kilborn
              last edited by

              @Alan-Kilborn

              Thank you so much.

              This will save me a lot of time.

              1 Reply Last reply Reply Quote 1
              • First post
                Last post
              The Community of users of the Notepad++ text editor.
              Powered by NodeBB | Contributors