Rainie3535 / sigil

Automatically exported from code.google.com/p/sigil
GNU General Public License v3.0
0 stars 0 forks source link

Automation for no word wrap with several symbols ("—" as example. EXTREMELY important in Spanish ebooks) #1096

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Let me explain the issue and the feature request which would be EXTREMELY 
useful for Spanish books.

When you are typing dialogues in English you usually use the following 
structure:

"Bla, bla, bla," John said. "Bla, bla, bla."

But in Spanish you type that sentence in this way:

—Bla, bla, bla —John said—. Bla, Bla, Bla.

Do you imagine the problem? "—", or whatever other dash you use, are not 
non-breaking symbols so you can easily end with the following displays:

—Bla, bla, bla —
John said-. Bla, Bla, Bla.

or

—Bla, bla, bla —John said
—. Bla, Bla, Bla. 

Both forms are just horrible. The correct writing is that "—John" or 
"said—." are treated like indivisible words.

How to fix it in HTML/ePUB? Well, you have to code '<span 
class="nw">—John</span>' where you have a '.nw {white-space: nowrap}' CSS 
definition.

As you can imagine, manually doing this through the whole ePub can be a serious 
PITA.

So I would like to ask for a way to add this <span> tags in an automatic way.

I propose a semi-automatic way which only involves improving Search and Replace 
functions. It would be the addition of some kind of wildcard in the searching 
and replace functions. I mean, imagine that # is a wildcard which means 'any 
word'. Then I could make a ' —#' search and then replace all with ' <span 
class="nw">-#</span>' in order to solve the issue.

Original issue reported on code.google.com by alr...@gmail.com on 8 Nov 2011 at 8:45

GoogleCodeExporter commented 9 years ago
I appreciate its important.  But as you indicated you can fix this yourself 
using Find and Replace and a bit of regex which has the ability to search for 
words.  I suggest you post on the MobileRead Sigil forum and you'll get plenty 
of help on how to do this.

Original comment by meme90...@gmail.com on 23 Mar 2012 at 5:15

GoogleCodeExporter commented 9 years ago

Original comment by daveheil...@gmail.com on 19 May 2012 at 3:20