Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pandoc MD item lists #13

Closed
npat-efault opened this issue Aug 21, 2015 · 4 comments
Closed

Pandoc MD item lists #13

npat-efault opened this issue Aug 21, 2015 · 4 comments

Comments

@npat-efault
Copy link

Pandoc MarkDown supports item, or definition, lists. They look like this:

This is the item title
:    This is the definition paragraph which
     may span several lines

If I put the cursor over the definition paragraph and press M-q (fill paragraph), emacs messes up everything. This makes it totally unworkable for texts with this kind of lists.

As a quick fix I added the ":" charater to the regexp that recognizes list items.

(defconst markdown-regex-list
  "^\\([ \t]*\\)\\([0-9#]+\\.\\|[\\*\\+-:]\\)\\([ \t]+\\)"
  "Regular expression for matching list items.")

This allows me to enter the definition above as:

This is the item title

:    This is the definition paragraph which
     may span several lines

and have M-q work. This is valid Pandoc Markdown, but it would be nice if I could omit the blank line.

Thanks for making markdown-mode available!

@npat-efault
Copy link
Author

Here is description of definition-lists in the Pandoc manual:

http://pandoc.org/README.html#definition-lists

@jrblevin
Copy link
Owner

jrblevin commented Sep 9, 2015

Thanks for this patch. I like that this allows filling of definitions more thoroughly than 84a49f6, and it also allows one to use the list editing commands to move items up and down, etc. However, doing it this way makes ordered/unordered list items and definition list items semantically equivalent, which has the potential to break other things. (This regular expression is used 15 times elsewhere for syntax highlighting, etc.)

I'd prefer to do it in a way that treats definition lists separately where appropriate (but also still leveraging existing code where possible, like the list editing commands). I think it would be best to create a new regular expression for definition lists and use it directly in the fill prefix and elsewhere as needed.

@npat-efault
Copy link
Author

Thanks for considering.

Obviously my patch was a quick and dirty solution. No doubt there are much better ways to support definition lists.

@jrblevin
Copy link
Owner

jrblevin commented May 9, 2017

This should be fixed now in 12c1289. Also font lock, list item reordering, etc. should work too.

@jrblevin jrblevin closed this as completed May 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants