• Resolved lolo343

    (@lolo343)


    I have an issue withe this plugin.
    The website is in french an nothing happened with this plugin or another plugin (french typo)
    No spaces after or before , ; () … and nothing options
    Somebody has an idea ?

Viewing 15 replies - 1 through 15 (of 22 total)
  • 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.

    Thread Starter lolo343

    (@lolo343)

    nothing happened ://

    Plugin Author pepe

    (@pputzer)

    You have to clear the cache.

    Thread Starter lolo343

    (@lolo343)

    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?

    Thread Starter lolo343

    (@lolo343)

    Thread Starter lolo343

    (@lolo343)

    it’s seem to work for hyphens

    Thread Starter lolo343

    (@lolo343)

    it’s ok before a ‘?’

    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).

    Thread Starter lolo343

    (@lolo343)

    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 7 years, 10 months ago by pepe.
    • This reply was modified 7 years, 10 months ago by pepe.
    Thread Starter lolo343

    (@lolo343)

    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' );
    Thread Starter lolo343

    (@lolo343)

    Thank you but doesn’t work.
    The text has disappeared.Curious…
    This option might be interesting to add to the plugin in the future

    Thread Starter lolo343

    (@lolo343)

    Missing space between $1 and $2 ? but not working again.
    The text is now displayed but no changes about spaces

Viewing 15 replies - 1 through 15 (of 22 total)
  • The topic ‘doesn’t work on customer’s website’ is closed to new replies.