Quote:
Originally Posted by mjcatt
In written spanish dialog, em dash is used somewhat like quotes in english and there are some times where it is followed by a period, for example: —. or possibly —,
[...]
Also, as far as I can tell, there is no accepted HTML/CSS code (except possibly for one inconvenient depreciated <nobr> tag), but I'm no expert.
Does anyone know of a way the keep these punctuation characters together?
|
You may want to try this:
1. Using the
"Word Joiner" Character
Open up your EPUB, and:
Search: —.
Replace: —⁠.
Search: —,
Replace: —⁠,
That should "combine" the dash + period/comma into a single chunk, telling Moon+ not to line-break there.
2. If that doesn't work, then maybe a CSS solution.
(Although Moon+ is one of the bad readers that throws away all "publisher CSS". I recommend using a more standards-compliant reader.)
We discussed lots of different methods in
2019: "No break space and alignment".
This one is extremely hackish, so it's not recommended:
HTML:
Code:
<p>—Se habrá perdido —respondió <span class="nobreak">Billy—.</span> Vamos.</p>
CSS:
Code:
.nobreak {
white-space: pre;
}
In English, that CSS tries to say:
"Hey, I already pre-did the linebreaks+spacing here for you. Keep Billy + EM DASH + PERIOD all together. Don't you mess with it!"
You may be able to more easily apply this to your book by using this regex:
Search: (\w+)—([,\.])
Replace: <span class="nobreak">\1—\2</span>
which looks for:
1. Any letters
2. EM DASH
3. comma OR period
then wraps the <span> around it.
But again, I don't recommend mangling up all your code for this. Instead, use a much better reader that actually follows the standards. (
PocketBook is a very good reader on Android.)