Community
    • Login

    Replace characters from certain lines

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    5 Posts 2 Posters 598 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.
    • MV82M Offline
      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 Offline
        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 Offline
          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 Offline
            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 Offline
              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

              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