-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add the fixer NoSpaceBeforeComma #13
Conversation
Yup, plz fix this @clairecoloma :) |
{ | ||
public function fix($content, StateBag $state_bag = null) | ||
{ | ||
$content = preg_replace('@(\w+) *(,) *'.Fixer::NO_BREAK_SPACE.'*@mu', '$1$2'.Fixer::NO_BREAK_SPACE, $content); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\s pour gérer tous les types de whitespace au lieu de l'espace seul non ?
It would be good to have a test for this ;) |
My eyes are broken, now I see the light, I see those tests ! |
Thanks @clairecoloma for this well done PR, Otherwise, we could just set back a normal space (or the space captured in the regexp). |
Yeah you're right, we can use a normal space instead of a NO_BREAK_SPACE. |
IMO, we have to use a normal space, and not a no break space. |
Any reason to not keep the original character after the coma? Mathieu Le 10 févr. 2015 à 10:29, Benjamin Clay notifications@github.com a écrit : IMO, we have to use a normal space, and not a no break space. — |
I don't see any reason to put a no break space here, I think that it should really be a simple space. But if there's no specs, yeah, just keep the original character. |
@@ -107,6 +107,10 @@ FrenchNoBreakSpace | |||
Replace some classic spaces by non breaking spaces following the French typographic code. | |||
No break space are placed before `:`, thin no break space before `;`, `!` and `?`. | |||
|
|||
NoSpaceBeforeComma | |||
------------------ | |||
Remove space before a `,` and add a non breaking spaces after. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description need to be updated too ;)
Thanks @clairecoloma I just merged the feature! |
Hello,
This PR manage spaces before and after a comma.
Like you can see in tests
Superman , you're my hero
becomeSuperman, you're my hero