SublimeText-Markdown / MarkdownEditing

Powerful Markdown package for Sublime Text with better syntax understanding and good color schemes.
MIT License
3.17k stars 649 forks source link

Automatic list bullets within YAML frontmatter #726

Closed bighairydave closed 1 year ago

bighairydave commented 1 year ago

When editing markdown files with YAML frontmatter, pressing enter within a list in the body of the file inserts a new bullet (asterisk, hyphen etc) on the next line. However when editing a list within the frontmatter, a hyphen is not entered on each new line (although indentation spaces are preserved).

---
title: "title text"
date: 2023-02-06
list:
  - I would like
  - these hyphens 
  - to be inserted automatically
  - because my lists are very long
---

* these asterisks
* are inserted automatically
* which is nice

Is this a bug, feature, or a setting that I have overlooked? Is there something I can easily hack to get the auto-insertion of hyphens to extend to the frontmatter section?

deathaxe commented 1 year ago

Frontmatter is highlighted by embedding YAML.sublime-syntax. As such they are treated as YAML source in all aspects.

As YAML syntax doesn't provide such auto adding "bullets" feature, it is not present. MarkdownEditing is not designed to inject any special behavior into YAML frontmatter, atm.

It may be possible, but as the situation is the same with writing normal YAML files such as CI workflows for Github Actions etc., I don't see a reason, why MarkdownEditing should add it.

That's probably something a plugin could handle for all YAML content, globally.

bighairydave commented 1 year ago

Thanks, that's a clear explanation of why this would be out of scope for MarkdownEditing.