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

"#" character escaping in the gitflow template doesn't seem to work #1596

Closed
rrussell0 opened this issue Mar 11, 2024 · 2 comments
Closed

"#" character escaping in the gitflow template doesn't seem to work #1596

rrussell0 opened this issue Mar 11, 2024 · 2 comments

Comments

@rrussell0
Copy link

In this template file:
https://github.com/rfennell/AzurePipelines/blob/main/SampleTemplates/XplatGenerateReleaseNotes%20(Node%20based)/Version%203%20(and%20later)/gitflow-template.hbs

The commits section:
{{#forEach commits}}
{{truncate id 5}} by {{author.displayName}} {{#if (gt changes.length 0)}}({{inflect changes.length "file" "files" true}} changed) {{/if}}- {{replace message '#' '# '}}
{{/forEach}}

This seems to have a replace method that should escape # symbols, but this doesn't seem to be happening. Do I need to explicitly add the handlebars-helpers extension to the task somewhere? I've tried to modify the replace statement but I have one specific ticket that used markdown that breaks the formatting of the release notes.

  1. Have a PR/commit that contains "####" in the commit message
  2. Generate release notes
  3. View release notes to see that the TOC is broken due to picking up the # # # #.
@rfennell
Copy link
Owner

You should not need any special declaration for the replace function as it is including automatically as part of the https://github.com/helpers/handlebars-helpers?tab=readme-ov-file#replace.

You can of course write your own as detailed here but you should not need to

Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants