View Single Post
Old 05-23-2020, 03:01 PM   #6
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,360
Karma: 20212223
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Edit - DOH - Ninja'd again...


Try -

Code:
search:
<div>\s*<p>(.*?) Fig._(.*?) e Fig._(.*?)\), (.*?).</p>\s*</div>

replace: 
<div class="images">\n<p>\1 Fig._\2)<img alt="Fig_\1" src="../Images/Fig_\1.jpg" /></p>\n<p>e Fig._\3),<img alt="Fig_\3" src="../Images/Fig_\3.jpg" />\4.</p>\n</div>
That will result in the following:
Code:
<div class="images">
<p>vedi Fig._3.1)<img alt="Fig_3.1" src="../Images/Fig_3.1.jpg"/></p>
<p>e Fig._10.6),<img alt="Fig_10.6" src="../Images/Fig_10.6.jpg"/>allora si puņ.</p>
</div>
That is not exactly what you asked for - it has some improvements. You can obviously modify it as you wish.

You should avoid inline styling whenever possible (don't put 'style="..." ' in your tags). Instead, put the styling in a CSS file and refer to it with class names like:

CSS:
Code:
.images p   {text-align:center; font-size:1em; margin:0}
.images img {display:block; margin:0 auto; width:90%; max-width:600px}
This makes it MUCH easier to review/read and you can edit with a change at a single location. The max-width should be set based on your image sizes - this keeps your small images from being over-blown and fuzzy on larger displays.
Turtle91 is offline   Reply With Quote