I'm using Serendipity in an environment with several bloggers and different groups of people that get automatic emails depending on the category of the post. Some of the bloggeres have the habit (as I do myself) of putting two spaces to start a sentence after a period. My issue is that this is converted to
(I.e. non breaking space plus a blank space) in the email. Entries become difficult to read. I'm sure someone would have had a similar issue and knows of the setting to get around this.
I have already scoured the general and plugin settings for something that might make sense. I have selected yes for each of the following two options in the Email plugin: Remove HTML?, Convert HTML-paragraphs to newlines?.
Are you using the WYSIWYG editor? In this case, this one is inserting the spacing, because in HTML there is no double space without this.
You could use the content-replace plugin to replace " " with only " ", maybe?
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Indeed, I am using the FCKeditor as it allows for selectable templates which helps my users. I have also tried the content-replace plugin with no luck, but using the FCKeditor I haven't been able to get the content-replace plugin to replace anything.
What did you try to enter in the content-replace plugin, and how did you configure it? Basically, this should work...
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Thanks Garvin. Here is my config modelled after the example in the "Using Plugins" section of the documentation. I apologize if I've mis-interpreted the fields. Let me know if you see anything incorrect.
Grmbl, I see. The plugin has trouble replacing special characters like spaces, because the regular expressions assume that the replaced word must be within spaces.
Hrm. The other way to do that replacement would be with a very simple custom event plugin.
Save this code as /plugins/serendipity_event_nonbsp/serendipity_event_nonbsp.php and then install the plugin:
<?php
class serendipity_event_nonbsp extends serendipity_event {
var $title = 'No double space';
function introspect(&$propbag) {
global $serendipity;
$this->title = $this->get_config('title', $this->title);
$propbag->add('name', $this->title);
$propbag->add('event_hooks', array(
'frontend_display' => true
));
}
function event_hook($event, &$bag, &$eventData) {
global $serendipity;
$hooks = &$bag->get('event_hooks');
if (!isset($hooks[$event])) {
return null;
}
switch($event) {
case 'frontend_display':
if (isset($eventData['body'])) {
$eventData['body'] = str_replace(' ', ' ', $eventData['body']);
}
if (isset($eventData['extended'])) {
$eventData['extended'] = str_replace(' ', ' ', $eventData['extended']);
}
return true;
break;
}
}
}
HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/