Comments (6)
I've made a PR to solve this scenario. It would be great if you can check it :D
from slug-generator.
Any progress on this? it would be very nice to have this option. I really need it. The capability to override method replaceWithDelimiter
(and others really) could be cool too, in order to allow extensibility of library
from slug-generator.
@Rumi-Aguirre can you describe your use case in detail? Maybe with some examples?
from slug-generator.
Sure!
I'm currently centralizing the logic of slug making and it must be backward compatible and I found the requirement that not allowed chars at the end of the input must be replaced by delimiter char but not trimmed. Some examples (input -> slug expected):
"sugiartoss_" -> "sugiartoss-"
"_sugiartoss_" -> "sugiartoss-"
"_sugiartoss-" -> "sugiartoss-"
assuming that delimiter is a dash "-"
from slug-generator.
"_sugiartoss_" -> "sugiartoss-"
so the behavior in the beginning of the string should be different than at the end of the string?
from slug-generator.
In this particular example I want to remove from begining but keep at the end but It would be nice if this behavior can be configured the same way that options like "delimiter" or "validChars". So can decide if want to trim the char just from beginning, from the end, from both or none to cover all use cases.
from slug-generator.
Related Issues (20)
- Error PaletteManipulator during update with Manager HOT 2
- Add Interface for the SlugGenerator class
- Japan letter but translate to Chinese (i think) HOT 2
- Warning: unable to open ICU transliterator with id "Latin-Upper" HOT 3
- Class 'SlugGenerator' not found HOT 1
- Void type hint is specific for PHP HOT 2
- Correction in Hindi Phrases HOT 1
- Verify if slug is valid. HOT 4
- How to force slug-generator not to convert a comma? HOT 2
- Wrong transforms for Cyrillic letters HOT 2
- Got error from your library. HOT 5
- Attempted to load class "Normalizer" from the global namespace. HOT 15
- requirements incompatible with your PHP version, HOT 4
- Implement CLDR fallback chain
- Add support for Emoji
- Cyrillic/Russian generation HOT 3
- Support for php >8.1 HOT 2
- Ability to reverse slug HOT 1
- Add requirement for ICU 4.6 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from slug-generator.