Title case filter with apostrophes

I convert some text in my template to title case using:

page.title | title

When there is an apostrophe in the text, it gives unexpected results:

For example with this input:
“Steiner’s theorem”

Expected result: “Steiner’s Theorem”
What I get: “Steiner’S Theorem”

Is there any way to get around this?

The issue is reproducible here:

with the input you mentioned:
{{ “Steiner’s theorem” | title }}

It seems like a possible issue in Tera or one of its dependency.

I created an issue here: Title case filter with apostrophe - Capitalize issue · Issue #771 · Keats/tera · GitHub

1 Like