Skip to content

[markdown mode] Fix inappropiate behavior of continuelist addon#3178

Closed
marcelgerber wants to merge 2 commits intocodemirror:masterfrom
marcelgerber:continuelist-inquote
Closed

[markdown mode] Fix inappropiate behavior of continuelist addon#3178
marcelgerber wants to merge 2 commits intocodemirror:masterfrom
marcelgerber:continuelist-inquote

Conversation

@marcelgerber
Copy link
Copy Markdown
Contributor

Steps to reproduce the issue:

  1. Go to http://codemirror.net/mode/markdown/index.html
  2. Replace all the text with - -- (which is a horizontal ruler)
  3. Press Enter

Result:

- --
- 

Expected:

- --

The issue was that state.quote, a numeric value, was compared to false.

I also improved the markdown mode a tiny bit.

@marijnh marijnh closed this in 62af9c6 Apr 5, 2015
@marijnh
Copy link
Copy Markdown
Member

marijnh commented Apr 5, 2015

I think my patch is less invasive, but if it misses something your patch solves, let me know.

@marcelgerber
Copy link
Copy Markdown
Contributor Author

I just noticed inQuote won't ever be false, for the reasons I wrote above.

@marijnh marijnh reopened this Apr 5, 2015
@marijnh
Copy link
Copy Markdown
Member

marijnh commented Apr 5, 2015

Ah, you are entirely right. I didn't expect an unrelated patch in the pull request, and completely misinterpreted the code. I've merged your solution instead, as well as your cleanup patch.

@marijnh marijnh closed this Apr 5, 2015
@marcelgerber
Copy link
Copy Markdown
Contributor Author

Well, I don't exactly know why, but this fix (and yeah, to be honest, it looks pretty unrelated) fixed the issue for me!

@marcelgerber
Copy link
Copy Markdown
Contributor Author

For little more background:
As inQuote was always true, !inList && !inQuote in the if condition was always false, even though inList was correctly set to false.

Thus, it should still work after you revert your unneeded commit.

@marcelgerber marcelgerber deleted the continuelist-inquote branch April 7, 2015 16:52
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

Successfully merging this pull request may close these issues.

2 participants