How Can I insert template surrounding a highlighted text/image?

What I’m trying to do

I was trying to use paragraph html with styling like this

<p style="text-align: center"><img src="https://upload.wikimedia.org/wikipedia/commons/0/07/Diagram_of_the_prophetic_perfect.png"  width="400"></p>

and I want to use this <p style="text-align: center">...</p> to other image and text i want to align with template to reduce my time editing the format of each image.

Things I have tried

I have tried to make two templates, the one is opening tag <p style="text-align: center>, and the other is the closing tag </p>. But is there in any way I can highlight text/image and input templates that the text will be inserted into the spesific place of my templates?

to add the context, I want the highlighted text to be wrapped in the p tag (opening and closing), with the ... above is referring to the highlighted text.

Give this a try:

thanks a ton! I might just have wrong concept that I grasped, instead of searching template, I should’ve search the word specific for the problem I need to solve

Great! Yeah, it’s a simple but super useful plugin.

You can use the community plugin Templater for something like this, but you’d need to write the template code for selecting text and placing it between the tags.

Wrap with shortcuts is ready to go out of the box.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.