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

Format slug incorrectly converting accented characters #118

Closed
BenTangible opened this issue Jun 17, 2024 · 1 comment
Closed

Format slug incorrectly converting accented characters #118

BenTangible opened this issue Jun 17, 2024 · 1 comment
Assignees

Comments

@BenTangible
Copy link

Commit a7af4a1 was added a few months ago to convert accented characters to non-accented ones when saving a template slug and when using <Format slug>. I'm pretty sure this worked when it was first released, but it was just reported on the forum that while this does still work for templates, the Format tag isn't properly converting things to slugs (e.g. é becoming %c3% instead of e).

@eliot-akira
Copy link
Contributor

eliot-akira commented Jun 17, 2024

Ah, I see. I checked and <Format slug> is not using the function format\slugify() in the Framework, which was updated in that commit. This function is what's used to generate a post slug from title when a template is saved. So the commit solved #96, but the issue with accented characters remained with <Format slug>.

It was a simple fix (commit 22cf724) but - looking over the code for the Format tag, in the folder language/format, I notice there's unfinished work where I'd started consolidating all the formatting functions into a general-purpose Format module in the Framework in framework/format.

I'll create an issue to track it:


Oh, in the Format tag function, I see there's an undocumented attribute count. It was added to count the number of items in a list, but also supports counting characters in a string (text).

Recently I was reading your exchange in the forum about creating an excerpt:

We keep coming back to this topic of custom excerpts, so I understand there's a need for a better way to do things. This <Format count> looks like it could help in that direction, for checking if a string needs to be trimmed.

<Format count>abcdefg</Format> = 7

Reminder to document this 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

No branches or pull requests

2 participants