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

Setext Heading and List Formatting Glitch #139

Closed
hmelman opened this issue May 7, 2016 · 4 comments
Closed

Setext Heading and List Formatting Glitch #139

hmelman opened this issue May 7, 2016 · 4 comments

Comments

@hmelman
Copy link
Contributor

hmelman commented May 7, 2016

There's a formatting glitch when using checkbox lists. If you have a list item, go to a new line and start another one, when you type the first hyphen, the previous line changes font-locking (the font size increases like a heading). E.g., type the following into an empty gfm-mode buffer.

- [x] foo
-

It doesn't matter if the box in the first line is checked or not. When you type the space after the hyphen on the second line, the first line reverts to correct formatting. If you then delete the added space, the first line doesn't change.

@jrblevin
Copy link
Owner

jrblevin commented May 7, 2016

I've seen this too. It's unrelated to checkboxes. The problem is that

- foo
-

is technically a setext heading "- foo". Possible solutions would be to require setext headings to have two or more hyphens or to prohibit a setext header from beginning with a hyphen. Neither one is a perfect solution though.

@hmelman
Copy link
Contributor Author

hmelman commented May 7, 2016

I see. As someone who never uses setext headings, having an option I could turn off would be a fine solution. It could disable them all together or enable one of the less than perfect solutions.

@hmelman hmelman changed the title Checkbox List Formatting Glitch Setext Heading and List Formatting Glitch May 7, 2016
@jrblevin
Copy link
Owner

jrblevin commented May 9, 2016

Let's go with the second approach above for now (don't allow setext headers to begin with hyphens).

@hmelman
Copy link
Contributor Author

hmelman commented May 9, 2016

I agree that seems like the least onerous restriction of the choices.

jrblevin added a commit that referenced this issue Dec 22, 2016
Fixes an error in the setext header regular expressions. The hyphen
needs to be at the end of the class so that it isn't interpreted as a
range.  This also adds tab as a prohibited character.

This closes GH-143 and is related to GH-139. Thanks to Howard Melman
for reporting these issues.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants