craftcms / craftcms/cms

camel and snake filters not removing punctuation

Open
#5,870 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
3.6k
Forks
705
Avg merge
1d 5h
Merged PRs (30d)
134

Description

Description

Punctuation (commas, dots, exclamation points) is not removed when applying the camel or snake Twig filters.
The kebab filter does remove punctuation.

I'm not sure when this changed, but in both Craft 2.7 and Craft 3.1.33 punctuation is removed with all three filters.

This definitely seems like unexpected behaviour/a bug?

Steps to reproduce
Additional info
  • Craft version: 3.4.11
  • PHP version: 7.2.20
  • Database driver & version:
  • Plugins & versions:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue in Craft 3.4.11 with the camel, snake, and kebab filters using commas, dots, or exclamation points. Compare the results with the stated Craft 2.7 and 3.1.33 behavior; done means punctuation handling is consistent with the expected behavior and the filters no longer regress.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.