I have a piece of HTML like this:
<pre class="script">template("main/GlobalShared");</pre>
<pre class="script">
var link = '/Draft/Tracker_1.1';
if (wiki.pageexists(link)) {
<div class="version"> web.link(wiki.uri(link), 'Version 1.1') </div>
}
</pre>
I need to convert it like this:
<pre class="script">template("main/GlobalShared");</pre>
<pre class="script">
var link = '/Draft/Tracker_1.1';
if (wiki.pageexists(link)) {
<div class="version"> web.link(wiki.uri(link), 'Version 1.1') </div>
}
</pre>
I have been fiddling with regular expressions but I can't seem to get even close. I think my choice is completely wrong.
Can anyone point me in the right direction if this is even possible?
Use a HTML parser instead, then simply replace the quotes with
.replace('"', '"')
.BeautifulSoup makes this task easy: