Quote:
Originally Posted by mncowboy
Is there a single regex that can do this in Sigil?
Thanks in advance.
|
Find:
Code:
<a href="#_edn(\d+)" name="_ednref(\d+)" title=""><span class="MsoEndnoteReference"><span class="MsoEndnoteReference"><b><span style="font-size:8.0pt;font-family:"Times New Roman","serif";color:black">\[(\d+)\]</span></b></span></span></a>
Replace:
Code:
<a href="#_edn\1" id="_ednref\2" title=""><sup>[\3]</sup></a>
Or if you know, absolutely, that the numbers will always be the same across each instance:
Find:
Code:
<a href="#_edn(\d+)" name="_ednref\d+" title=""><span class="MsoEndnoteReference"><span class="MsoEndnoteReference"><b><span style="font-size:8.0pt;font-family:"Times New Roman","serif";color:black">\[\d+\]</span></b></span></span></a>
Replace:
Code:
<a href="#_edn\1" id="_ednref\1" title=""><sup>[\1]</sup></a>
NOTE: I replaced the "name" attribute with "id" because "name" is old and tired.
EDIT: The above stuff is all based on the assumption that the <b>, <span>, and font-family/size stuff is identical in all of the original endnote code instances. You'd need to make judicious use of (.*?) if not.
(and I had a mistake in the first edition of this post that I corrected)