Issue template format should be more forgiving #5987

Closed
opened 2025-11-02 06:42:01 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @jolheiser on GitHub (Sep 11, 2020).

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)

Originally created by @jolheiser on GitHub (Sep 11, 2020). The recently merged #11450 contains a potential flaw. ## The problem Using the example I added to the docs ```yaml ----- 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. ```yaml 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)
GiteaMirror added the type/bug label 2025-11-02 06:42:01 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#5987