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

Escape characters like < and > #122

Open
AmirHosseinKarimi opened this issue Jan 14, 2024 · 3 comments
Open

Escape characters like < and > #122

AmirHosseinKarimi opened this issue Jan 14, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@AmirHosseinKarimi
Copy link

Describe the bug
Characters like < and > are parsed as markdown syntax and won't shown in output.
Something like feat: add <Header> to <App> will shown as: feat: add to

Current behavior
Characters like < and > are parsed as markdown syntax.

Expected behavior
Escape markdown syntax from commit messages.

Environment

  • commit-and-tag-version version(s): 12.1.0
  • Node/npm version: v20.3.1
@AmirHosseinKarimi AmirHosseinKarimi added the bug Something isn't working label Jan 14, 2024
@TimothyJones
Copy link
Member

I'm not able to reproduce this -

mkdir example
cd example
touch readme.md
git add readme.md
git commit -m "feat: example <with tag>"
npx commit-and-tag-version

generates a changelog with:

## 1.1.0 (2024-01-15)


### Features

* example <with tag> dfa9580

As an aside, I think having markdown syntax in commit messages is actually helpful - as it lets you format code (useful for the tag syntax):

# note the single quotes
 git commit -m 'feat: example `<with tag>`' 

@AmirHosseinKarimi
Copy link
Author

Yea, the generated changelog is correct. But the < & > characters will be parsed and won't shown in the output.
Also, I agree that having markdown syntax in the commit message is helpful, But I think it will be awesome if we can have an option to parse or escape it.

@TimothyJones
Copy link
Member

Ah, I see what you're getting at.

...characters will be parsed

Am I right in understanding that the issue is that they're parsed by markdown, because they weren't escaped at the time the markdown file is written?

I think escaping the characters that markdown interprets would be a bit unexpected, so this doesn't feel like a bug to me. But, I see how it might be useful to be able to do this with a config option.

This project is intended to be a wrapper around conventional-changelog. Conventional-changelog controls the writing of the changelog, and I think the package that knows how to write markdown is conventional-changelog-writer (although I'm not certain). You might want to open an issue / PR over there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants