MarkdownEditing icon indicating copy to clipboard operation
MarkdownEditing copied to clipboard

add support for definition lists

Open CircleCode opened this issue 11 years ago • 15 comments

definition lists are defined, for example, in php markdown extra, with this syntax:

term
:   definition

    definition continuation (because previous line begin with 4 spaces)

see http://michelf.ca/projects/php-markdown/extra/#def-list for full explanation.

currently, definition continuation is highlighted as code block while this is correctly highlighted for list continuation (see image below)

capture d cran de 2013-11-20 09 59 58

CircleCode avatar Nov 20 '13 09:11 CircleCode

Hmm, thanks for reporting.

In order to implement this, we need to add PHP markdown extra as a new flavor. For GFM, that's the expected behaviour.

As I check the page, PHP md extra has too many custom features. I wish these flavors merge one day ;)

maliayas avatar Nov 20 '13 13:11 maliayas

I understand your answer (and to be honest, approve it in a certain way), but it seems to me that this syntax is a widely adopted one (not full php markdown extra, but the one for definition lists), see for example mmd supporting it: https://github.com/fletcher/MultiMarkdown/wiki/MultiMarkdown-Syntax-Guide#definition-lists or a python extension to markdown syntax: http://pythonhosted.org/Markdown/extensions/definition_lists.html

I also wish all those flavors will merge one day, but I think it is unlikely to be the case in short time…

CircleCode avatar Nov 20 '13 13:11 CircleCode

Do you mean we should implement it in "Markdown GFM"? If that is the case, I think it's not an appropriate solution. We need to sell what we advertise.

maliayas avatar Nov 20 '13 13:11 maliayas

in fact, you're right that this has nothing to do in "Markdown GFM", and I don't know where it could be defined… <brainstorming allow-naive-questions-or-proposal="true"> is it possible in ST3 do define modular syntaxes? if yes, maybe we can explore this way with a "modular md" syntax? </brainstorming>

CircleCode avatar Nov 20 '13 13:11 CircleCode

Syntaxes in ST are pretty complicated. They can import each other for example; but it's unbelieveably easy to break things while fixing other things. And everything is regex based. Does "modular syntax" have a special meaning? I haven't heard it before.

maliayas avatar Nov 20 '13 13:11 maliayas

OTOH maybe we can create an all in one syntax that will support many flavors at once until the possible extend.

maliayas avatar Nov 20 '13 13:11 maliayas

Does "modular syntax" have a special meaning? I haven't heard it before.

Nope, this is the way I tried to define a syntax where some parts could easily be activated or not

OTOH maybe we can create an all in one syntax that will support many flavors at once until the possible extend.

this is an interesting idea, but there is a danger of overlapping between syntaxes. maybe there must be a choice for each construct regarding its usage, its level of complexity to be implemented, and some other parameters…

CircleCode avatar Nov 20 '13 14:11 CircleCode

We can call these syntaxes modular. There is a repository feature for syntax definition. It works this way:

  1. You define your feature in the repository and give it an id.
  2. You import it in other parts using its id.

So it's easy to inject your module to other parts or comment out the include statement if you don't want it there.

I don't know if this helps what you want.

maliayas avatar Nov 20 '13 14:11 maliayas

maybe we could write your suggested "many flavors md", and make each include dependant of an user option?

CircleCode avatar Nov 20 '13 15:11 CircleCode

Let's keep the bug open for some time too see what other people think. Syntax development consumes too much time, so we should choose the right path in the beginning. Thanks for starting the discussion.

maliayas avatar Nov 20 '13 15:11 maliayas

yes, I think this is the best: let it open, and wait to see if people want this, and have some ideas on how to do this

CircleCode avatar Nov 21 '13 10:11 CircleCode

I would love to see this added, as it is also part of the pandoc 'flavor' markdown which I and many others use. See the description here. Pandoc is used heavily by academics, so it would be really great to see it supported in the MarkdownEditing Package. Unfortunately, I lack the skills to make any actual contribution to the coding side. The is a great Vim package here, (I'm transitioning from MacVim to Sublime Text 3) but I'm not sure the syntax highlighting code could be transferred to Sublime Text. In any case, MarkdownEditing is a great package, thanks for yours and Brett's efforts!

mclearc avatar Dec 06 '13 17:12 mclearc

I just noticed this problem too. I am using MultiMarkdown syntax to edit Markdown Extra files and everything I've tried so far works great. Here's what the def list problem looks like:

http://i.imgur.com/346BL7U.png

Markdown Extra and Multimarkdown are pretty similar and certainly the definition lists syntax is the same, so could you not just add the multi-paragraph support to the MMD syntax?

charlesroper avatar Dec 10 '13 22:12 charlesroper

We now have plans to support Pandoc markdown. See #167

maliayas avatar Mar 21 '14 21:03 maliayas

I would also love to see definition lists defined. I was hoping to use your plugin to help work on a library of pages written in PHP Markdown Extra, but this limitation is a killer.

alexfornuto avatar Sep 09 '14 19:09 alexfornuto