vsch / idea-multimarkdown

Markdown language support for IntelliJ IDEA.
https://plugins.jetbrains.com/plugin/7896-markdown-navigator
Apache License 2.0
813 stars 129 forks source link

Avoid auto-extending setext heading when it is actually a yaml doc separator #808

Closed jshook closed 4 years ago

jshook commented 4 years ago

When editing many markdown files which have frontmatter in the form of:

---
title: A title
weight: 9007
---

Heading 1
========

...

It can get very annoying when you're editing the weight or the last entry in the front matter and it keeps breaking your yaml doc separator, which is exactly 3 dashes: ---

For example, you end up with this:

---
title: A title
weight: 9007^ <- cursor here
------------
...

I know it's a little annoyance, but it's directly counter to the good help that the plugin provides when it does the correct thing. Some options to consider, in order of effort:

  1. Allow me to disable this particular feature
  2. Allow me to limit the size of all setext heading markers
  3. Detect front matter and disable editing assistance in that region of the file
vsch commented 4 years ago

@jshook, what version of the plugin are you using and on what IDE? I need to ask because there were so many changes in last few releases that it could be a bug in a particular version of the plugin.

In general there are a couple of things you can do:

  1. Enable the Jekyll Front Matter parser extension so YAML front matter is recognized, Parser Settings

  2. Disable Setext Header marker equalization in Editor > Code Style > Markdown > Headings.

image

  1. Last resort workaround if for some reason the other two are not desired or not working, add a blank line before the last ---, at least while editing.
jshook commented 4 years ago

2.9.11 The gist of my issue was that I mistakenly expected all the plugin settings to be under Language and Frameworks > Markdown.

I verified that both of these work for me, and opted for enabling the frontmatter parser. Thanks for the fast response!

vsch commented 4 years ago

@jshook, the IDE has a lot of settings and conventions on where to put them. I tried to keep with the convention hoping it would make it easier for users to find them.

In retrospect, Markdown is significantly different from other "languages" that this is not always possible or makes sense. Additionally, most users do not know the IDE well enough to look in all the far corners for settings. I am still discovering IDE features that were there for over a decade and I have been using it intensively and for plugin development for almost five years. It is a lot of terrain to cover.

There are Markdown Navigator related settings in