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

Fill-paragraph should ignore headers #159

Closed
mok0 opened this issue Aug 22, 2016 · 6 comments
Closed

Fill-paragraph should ignore headers #159

mok0 opened this issue Aug 22, 2016 · 6 comments
Labels

Comments

@mok0
Copy link

mok0 commented Aug 22, 2016

I installed markdown-mode a couple of days ago from the MELPA Stable, I am not sure what version I have.

When I use M-q to do fill-paragraph on a paragraph within markdown-mode, the text and headers are folded into the paragraph, so this:

# This is a header
Sed egestas molestie elit. Mauris urna mi, scelerisque vitae, ultrices vel, euismod vel, eros. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Pellentesque dictum felis a nisi.

becomes this:

# This is a header Sed egestas molestie elit. Mauris urna mi,
scelerisque vitae, ultrices vel, euismod vel, eros. Lorem ipsum dolor
sit amet, consectetuer adipiscing elit. Pellentesque dictum felis a
nisi.

If there is a second level header, it becomes even worse:

# This is a header # Another header Sed egestas molestie elit. Mauris
#urna mi, scelerisque vitae, ultrices vel, euismod vel, eros. Lorem
#ipsum dolor sit amet, consectetuer adipiscing elit. Pellentesque
#dictum felis a nisi.

I think this is not the right behaviour, headers should not be filled. Org-mode does it correctly.

@vyp
Copy link

vyp commented Aug 22, 2016

I am not sure what version I have.

M-x describe-package 😉

@mok0
Copy link
Author

mok0 commented Aug 22, 2016

Thanks, @vyp! This is the output from M-x describe-package:

    Status: Installed in `~/.emacs.d/elpa/markdown-mode-2.1/' (unsigned).
    Archive: n/a
    Version: 2.1
   Requires: cl-lib-0.5
    Summary: Emacs Major mode for Markdown-formatted text files
   Homepage: http://jblevins.org/projects/markdown-mode/
   Keywords: [markdown] [github flavored markdown] [itex]
    Other versions: 2.1 (melpa-stable).

@syohex
Copy link
Collaborator

syohex commented Aug 27, 2016

How about #162 ?

@mok0
Copy link
Author

mok0 commented Aug 27, 2016

Wow, a one line fix... it works perfectly, thanks a lot!

jrblevin pushed a commit that referenced this issue Aug 29, 2016
* Ignore header line at fill-paragraph
* Add test of #159 about fill-paragraph with header
@syohex
Copy link
Collaborator

syohex commented Aug 29, 2016

#162 was merged.

@jrblevin
Copy link
Owner

Many thanks for the report, @mok0, and for the patch, @syohex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants