MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Sigil (https://www.mobileread.com/forums/forumdisplay.php?f=203)
-   -   Quotation mark (https://www.mobileread.com/forums/showthread.php?t=286430)

Michit1 05-15-2017 11:33 AM

Quotation mark
 
Hello, I have an epub where no typographical quotation marks are in (Inch ").
If I want to change it, he also changes the XML Attribute e.g.
<link rel="stylesheet" href="../Styles/main.css" type="text/css"/> with.

How can I change the quotation marks to » and « or typographic correct “…”

Sorry for my bad english.

Turtle91 05-15-2017 12:04 PM

There are a few different ways to do this each with their own drawbacks:

1) You could remove the <link> by selecting all your html files in the book view, right click and select link stylesheets, then clear the checkboxes. Then run your search/replace, Then re-link the stylesheets. Unfortunately most headers include " in other locations like the doctype.

2) Run the search and replace in 2 passes. The first pass to replace the ", the second pass to replace the corrupted headers with a good one. Highlight the entire corrupted header, Push the Find&Replace button to copy the bad header, then type or paste a good header into the replace field. You may have to select the "DotAll" option.

3) Perform the Search/Replace on each individual html sheet (select "Current File") and deselect "Wrap". When you place your cursor just below the header it will replace all " until the bottom of the file. This will replace any " you have in class names though, so you would have to do a second search to replace those with the ".

4) Do a first pass to change the good " to something that is not used anywhere else in the book like:
search: "
replace: zzzxxxccc

Than do your normal search(es) to fix the ".

Then search and replace to put the original " back:
search: zzzxxxccc
replace: "

5) I'm sure some of the regex guru's have a method to ignore what's inside of the <> tag symbols, but I'm not smart enough to do that - maybe they can chime in with something.


I'd recommend #4 as being the least complicated, but choose whichever method you prefer.

Cheers,

KevinH 05-15-2017 12:14 PM

The easiest way might be to install the "Smarten Punctuation Plugin" which you can download from our forum

It will ignore all attributes and any quotes within tags.

Check out ...

https://www.mobileread.com/forums/sh...d.php?t=247088

and for a complete list of Sigil Plugins see:

https://www.mobileread.com/forums/sh...d.php?t=247431

Michit1 05-22-2017 12:11 AM

"Smarten Punctuation Plugin"

how does it work ? I do not understand the tool and it does not go.

https://www.mobileread.com/forums/sh...d.php?t=247088

Michit1 05-22-2017 04:49 AM

2 Attachment(s)
What must be set?

JustinThought 05-23-2017 08:25 AM

Quote:

Originally Posted by Michit1 (Post 3525025)
What must be set?

From the screen you have given us, select the files you want to smarten--Chap1 through Chap8, then press "Process." After a moment you will be told "8 files processed," click okay. Now you can do your search and replace on the new “smart quotes”, both the opening and the closing ones.

WS64 08-10-2017 09:34 AM

This thread is a bit older, but anyway, here's what I do in these cases:
Search for
(>[^<]*)old
and replace it with
\1new
"old" may include ", but anything (including ") within html tags will not be touched.


All times are GMT -4. The time now is 07:35 PM.

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.