![]() |
#1 |
Zealot
![]() Posts: 142
Karma: 10
Join Date: Sep 2016
Location: Montréal Québec
Device: Kobo Glo; Kobo Libra
|
Can't replace space with no-break space with my function since 5.23
I had a function for replacing some spaces with no-break spaces looking like this snippet:
return match.group().replace(' ;', ' ;') where: left a normal space, right a no-break space but now I don't get any changes with version 5.23 (I didn't try 5.22). What's change in Calibre and how can it make working? |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,307
Karma: 27111242
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
There werent any changes to the editor search replace in 5.23, what version did you update from and post the full function
|
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Zealot
![]() Posts: 142
Karma: 10
Join Date: Sep 2016
Location: Montréal Québec
Device: Kobo Glo; Kobo Libra
|
Quote:
def replace(match, number, file_name, metadata, dictionaries, data, functions, *args, **kwargs): return match.group().replace(' ?','*?').replace(' !','*!').replace(' ;','*;').replace(' :','*:').replace(' »','*»').replace('« ','«*') (This present editor change the no-break space with an * as you can see) the search string is <.*?> |
|
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,307
Karma: 27111242
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
I'm confused are you saying the function definition has changed?
|
![]() |
![]() |
![]() |
#5 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,307
Karma: 27111242
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
I tried creating a function that replaces spaces with nbsps and it works fine for me.
|
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Zealot
![]() Posts: 142
Karma: 10
Join Date: Sep 2016
Location: Montréal Québec
Device: Kobo Glo; Kobo Libra
|
Quote:
Just forget all. It was my search string which was wrong. |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
No break space and alignment | roger64 | ePub | 40 | 11-24-2019 11:29 PM |
Representing the no-break space | roger64 | Sigil | 11 | 08-09-2017 02:09 AM |
Narrow No-Break Space display | roger64 | Sigil | 6 | 12-20-2012 02:43 PM |
Narrow No-Break Space and commercial support. | roger64 | ePub | 8 | 09-04-2012 01:08 PM |
Is it possible to define rules for non break space? | habanr | Conversion | 4 | 02-22-2011 07:36 AM |