WordPress.org

Ready to get started?Download WordPress

Forums

wp-Typography
Feature request: space before punctuation for French (1 post)

  1. David Latapie
    Member
    Posted 1 year ago #

    Hi,

    I love your plugin, I installed it in all of my blog (granted, it sometimes mess up with computer code).

    I request the following feature:
    For French, add a narrow no-break space (U+202F) before an exclamation mark or a question mark. If there is already a space, replace it.
    Code-wise, I suggest this:
    - Delimiting the perimeter: a way to ensure the element is in French. Check that either "lang" or "xml:lang" is present/inherited and that the attribute is either "fr" ou starts with "fr-".

    - Search-replace:
    [^\u202F]([!?]) => \u202F\1 (if there is no narrow no-break space, add it)
    [\u2009 ]\u202F([!?]) => \u202F\1 (if there is a regular or thin space before the narrow no-break, delete it)
    This could probably be optimized.

    This could later be extended to more rules. I will not list them all here, one thing at a time :-)

    Thank you for taking time to consider it.

    http://wordpress.org/extend/plugins/wp-typography/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic