|
|
#1 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
search and replace - drops blanks in replace ?
i tried using S&R in epub to epub conversion to replace all mdash with space ndash space.
it seems that the replace function drops the leading & training spaces so what it actually does is to replace all mdash with ndash - not what I wanted ??? i then tried escaping the space characters but got failed conversion with that approach |
|
|
|
|
|
#2 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,609
Karma: 28549044
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Use –
|
|
|
|
| Advert | |
|
|
|
|
#3 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
that is self defeating, I want to make the change so that lines can be split on either side of the ndash ( once converted to Kindle) if needs be - a non breaking space either side would prevent that I assume.
other search / replace engines ( e.g. sigil) support leading / trailing spaces - they are somewhat essential when using regex to remove unwanted line feeds. as you need constructs like space\1 in your replace box. it would be MUCH faster to do a single find+replace & epub to epub convert in calibre that it is to go to sigil, set it to code view, set its find /replace to all files, all instances & then make the changes that way, but if leading trailing space cant be used.... & I guess there are other valid reasons for wanting to add extra ( normal) space via the search / replace engine |
|
|
|
|
|
#4 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,609
Karma: 28549044
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Use a unicode space character that isn't stripped. Since I didn;t write this bit of code, I cannot comment on why leading/trailing spaces are stripped, but I'd imagine it is to be consistent with the way spaces are handled everywhere else in calibre.
|
|
|
|
|
|
#5 |
|
Sigil & calibre developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,487
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
|
class Widget function get_value in calibre/gui2/convert/__init__.py is stripping white space at the beginning and end of QLineEdit and QTextEdit. So the spaces are never propagated along to the conversion pipeline.
|
|
|
|
| Advert | |
|
|
|
|
#6 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,609
Karma: 28549044
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You can override that behavior in the widget for search and replace. I don;t want to change it globally.
|
|
|
|
|
|
#7 |
|
Sigil & calibre developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,487
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
|
|
|
|
|
|
|
#8 |
|
US Navy, Retired
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,897
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
|
@cybmole Congratulations!!
![]() In case you hadn't noticed, you just reported a bug that is being corrected. |
|
|
|
|
|
#9 |
|
Sigil & calibre developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,487
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
|
|
|
|
|
|
|
#10 | |
|
US Navy, Retired
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,897
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
|
Quote:
Thanks for the fix, it sounds like one I might have run into in the future if it hadn't been fixed now. |
|
|
|
|
|
|
#11 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
|
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Search and replace not working | helmerer | Conversion | 4 | 02-25-2011 04:48 AM |
| Search and Replace problem | naro_c | Conversion | 5 | 02-25-2011 01:59 AM |
| Search & Replace | Pat Nickholds | Sigil | 2 | 10-22-2010 12:18 AM |
| Search and replace in 0.2.0 | paulpeer | Sigil | 7 | 03-13-2010 12:59 PM |
| Why no search and replace? | charleski | Sigil | 10 | 11-24-2009 05:13 PM |