Plugin Author
pepe
(@pputzer)
Assuming you have actually enabled the “French punctuation rules” setting, it is most likely that some plugin produces invalid HTML code. Add add_filter( 'typo_ignore_parser_errors', '__return_true' ); to your functions.php to ignore any parser errors.
Plugin Author
pepe
(@pputzer)
You have to clear the cache.
nothing after clearing cache, i don’t understand…
Plugin Author
pepe
(@pputzer)
Can you link to a screenshot of your settings and an example page?
it’s seem to work for hyphens
Plugin Author
pepe
(@pputzer)
Is there any whitespace in your string? If not, the regexes for French punctuation rules won’t match. Test. Test. Test; test (test) should be converted, but not Test.Test.Test;test(test).
Ok so it’s impossible because my customer wants
Ponctuation to be modified in text by
adding a space after :
-“.”
-“,”
-“;”
-“!”
-“?”
-“)”
space before and after
– “:”
Plugin Author
pepe
(@pputzer)
If your goal is to enter a sentence without any whitespace at all and have it come out correctly spaced, yes, that is not something wp-Typography was intended to do.
Since apparently your client does not care about heuristics, you could just do a str_replace filter on the content in your functions.php, though.
-
This reply was modified 9 years, 5 months ago by
pepe.
-
This reply was modified 9 years, 5 months ago by
pepe.
do you know what is the filter code with str_replace to add?
I do not want to bother you…
Plugin Author
pepe
(@pputzer)
Well, maybe you need preg_replace to make sure not to mangle any HTML entities.
Something like this (not tested, not optimized) should work:
function spacify( $text ) {
$text = preg_replace( '@(\w+)(\.|,|;|!|?|\))(^\s)@u', '$1$2 $3', $text );
$text = preg_replace( '@(\w+)(:)(^\s)@u', '$1 $2 $3', $text );
return $text;
}
add_filter( 'the_content', 'spacify' );
Thank you but doesn’t work.
The text has disappeared.Curious…
This option might be interesting to add to the plugin in the future
Missing space between $1 and $2 ? but not working again.
The text is now displayed but no changes about spaces