Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add spaces to angle quotes for French guillemets #378

Closed
aurelberra opened this issue Jul 21, 2017 · 11 comments
Closed

Add spaces to angle quotes for French guillemets #378

aurelberra opened this issue Jul 21, 2017 · 11 comments

Comments

@aurelberra
Copy link

In 2014 support was added for angle quotes in BlackFriday thanks to @bep (#128). However, the French guillemets would also require non-breaking spaces: "this" should not become «that», but « that ».

Such further enhancement would make a great difference for French users, as mentioned in Hugo issue #3725.

@bep
Copy link
Contributor

bep commented Jul 21, 2017

I can take a stab on this when I get some spare time, should not be too hard; but looking at this:

https://en.wikipedia.org/wiki/Guillemet

I guess we should add an option that should work for both "regular" and angled quotes, i.e. for gullimets in general.

@aurelberra
Copy link
Author

Do you mean enabling “quotes”, «double angle quotes» and « guillemets » (with  ) as options, the first one being the default? That would be really nice and would cover most needs! I'm happy to test if I can be of any help.

Adding British-style ‘quotes’ would make the list complete, I think – cf. for instance LaTeX csquotes package, which also deals with second-level quotes, but we probably don't need such sophistication here.

@bep
Copy link
Contributor

bep commented Jul 21, 2017

Currently we have:

  • HTML_USE_SMARTYPANTS=> regular quotes (I call them that ...)

If you add

  • HTML_SMARTYPANTS_ANGLED_QUOTES => Angled quotes (which fits the French norm)

If we add a new option:

  • HTML_SMARTYPANTS_QUOTES_NBSP

Which, in both cases above, will insert  .

@aurelberra
Copy link
Author

Ok, so you would combine two smartypants options. It seems fine, but I don't see how you could need   with the "regular", US quotes: what would be the “ use case ”?

@bep
Copy link
Contributor

bep commented Jul 21, 2017

what would be the “ use case ”?

I didn't know about the French use case, either -- but I don't care too much about the usefulness, it just makes sense and is the simplest way to add this.

@aurelberra
Copy link
Author

It has its own logic. If it's easier than adding an option like HTML_SMARTYPANTS_ANGLED_QUOTES_NBSP, then by all means!

@rtfb
Copy link
Collaborator

rtfb commented Jul 26, 2017

Wow, this baffles me a bit. Are you saying that there are cases in French when people write quoted text with extra spaces around it inside Guillemets?

@aurelberra
Copy link
Author

Yes, this is the norm: « TEXT » (though these are thin spaces in good typography).

@bep
Copy link
Contributor

bep commented Jul 26, 2017

It baffles me as well, but it is documented in the Wikipedia article linked above:

https://en.wikipedia.org/wiki/Guillemet

@rtfb
Copy link
Collaborator

rtfb commented Jul 27, 2017

Yes, this is the norm: « TEXT » (though these are thin spaces in good typography).

Damn, natural languages are weird :-)

documented in the Wikipedia article linked above:

Yeah, I missed that needle in the hay of information.

@inwardmovement
Copy link

It would be great to finalize french punctuation support according to #439

willdollman pushed a commit to willdollman/blackfriday that referenced this issue Feb 27, 2021
This commits adds flag `HTML_SMARTYPANTS_QUOTES_NBSP` which, when combined with `HTML_USE_SMARTYPANTS` will insert non-breaking spaces between the double quotes and the contained text.

This is mostly relevant for use in French  with `HTML_SMARTYPANTS_ANGLED_QUOTES`.

It should not hurt existing code path in the performance department:

```
name                     old time/op    new time/op    delta
SmartDoubleQuotes-4    2.58µs ± 1%    2.58µs ± 1%   ~             (p=1.000 n=5+5)

name                     old alloc/op   new alloc/op   delta
SmartDoubleQuotes-4    5.27kB ± 0%    5.27kB ± 0%   ~     (all samples are equal)

name                     old allocs/op  new allocs/op  delta
SmartDoubleQuotes-4      13.0 ± 0%      13.0 ± 0%   ~     (all samples are equal)
```

Fixes russross#378
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants