-
-
Notifications
You must be signed in to change notification settings - Fork 201
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
Custom function to collapse all whitespaces (incl newlines) into a single space #77
Comments
If a generated regex based replacement function can be added then I would like to replace this:
with a Tera or custom git-cliff function that does something like this in sed:
|
Hello! I recently pushed 64317f2 which makes it possible to manipulate commit messages before actually parsing/templating. Maybe it can also be utilized for your use-case like this: [git]
commit_preprocessors = [
{ pattern = " +", replace = " "}, # remove multiple whitespaces
{ pattern = "https://github.com/.*/issues/([0-9]+)", replace = "[Issue #${1}]"} # turn issue links into numbers
] Can you try this out? See commit_preprocessors for more information. |
Thank you! 🙇 . You can see me using this new feature in kaushalmodi/ox-hugo@cb2fad1 . |
Oh nice! You seem to use it very extensively, feel free to add new examples to README.md 😄 |
Is your feature request related to a problem? Please describe.
I write details git commit messages. So they often have newlines and indentations. But when
git-cliff
is parsing those, I would like to see a 1-liner commit message truncated to 90 characters. I would like to do something likes/\s+/ /g
as one would do insed
(i.e. collapse multiple spaces into a single space). But I cannot find a way to do regex based replacement using Tera.Describe the solution you'd like
Custom
git-cliff
function calledws_collapse
or something that reduces consecutive newlines, spaces, tabs into a single space.Describe alternatives you've considered
So I am doing this:
https://github.com/kaushalmodi/ox-hugo/blob/7af7e72e139655132cfa3ca5b9152690b8eaf1fe/doc/cliff.toml#L31-L35
The text was updated successfully, but these errors were encountered: