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

Issue template format should be more forgiving #12815

Closed
jolheiser opened this issue Sep 11, 2020 · 0 comments · Fixed by #12817
Closed

Issue template format should be more forgiving #12815

jolheiser opened this issue Sep 11, 2020 · 0 comments · Fixed by #12817
Labels
Milestone

Comments

@jolheiser
Copy link
Member

The recently merged #11450 contains a potential flaw.

The problem

Using the example I added to the docs

-----
name: "Template Name"
about: "This template is for testing!"
title: "[TEST] "
labels:
  - bug
  - "help needed"
-----
This is the template!

will not actually work.

This is because the ExtractMetadata func actually tries to parse everything within the separators, including the separators themselves. As a matter of fact if you look closely at the above block, syntax highlighting reveals the issue with the - separators.

While YAML does allow a similar format for "blocks", those must be three hyphens, which means currently issue templates expect a specific number of hyphens to work.

The solution

The ExtractMetadata func should only parse between the lines, e.g.

name: "Template Name"
about: "This template is for testing!"
title: "[TEST] "
labels:
  - bug
  - "help needed"

This would allow users to use any amount of hyphens (as long as it's two or more so that lists aren't confused as separators)

@jolheiser jolheiser added this to the 1.13.0 milestone Sep 11, 2020
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant