Skip to content
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

Merged
merged 3 commits into from
Jul 13, 2015

Conversation

clairecoloma
Copy link
Member

Hello,

This PR manage spaces before and after a comma.
Like you can see in tests Superman , you're my hero become Superman, you're my hero

@ternel
Copy link
Member

ternel commented Feb 3, 2015

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

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 ?

@mdarse
Copy link
Contributor

mdarse commented Feb 9, 2015

It would be good to have a test for this ;)

@mdarse
Copy link
Contributor

mdarse commented Feb 9, 2015

My eyes are broken, now I see the light, I see those tests !

@damienalexandre
Copy link
Member

Thanks @clairecoloma for this well done PR,
but I'm dubious about the use of a NO_BREAK_SPACE after the comma. There is no sign of it in the French typographic code I use, do you have any source mentionning this usage?

Otherwise, we could just set back a normal space (or the space captured in the regexp).

@clairecoloma
Copy link
Member Author

Yeah you're right, we can use a normal space instead of a NO_BREAK_SPACE.

@ternel
Copy link
Member

ternel commented Feb 10, 2015

IMO, we have to use a normal space, and not a no break space.

@mdarse
Copy link
Contributor

mdarse commented Feb 10, 2015

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.


Reply to this email directly or view it on GitHub
#13 (comment).

@ternel
Copy link
Member

ternel commented Feb 10, 2015

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.
Copy link
Member

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

@damienalexandre
Copy link
Member

Thanks @clairecoloma I just merged the feature!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants