Skip to content

Issue template format should be more forgiving #12815

@jolheiser

Description

@jolheiser

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions