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

Weird markdown syntax highlighting #959

Closed
JohnONolan opened this issue Oct 2, 2013 · 7 comments
Closed

Weird markdown syntax highlighting #959

JohnONolan opened this issue Oct 2, 2013 · 7 comments
Labels
affects:editor Work relating to the Koenig Editor bug [triage] something behaving unexpectedly

Comments

@JohnONolan
Copy link
Member

Accidentally discovered this bug while reporting #958

When typing the same char lots of times, eg: dddddddddddddd - Markdown thinks it is a link, and gives it a class of .cm-link (this should not happen)

scrollbug

@JohnONolan
Copy link
Member Author

Another false .cm-link insertion in this context

image

@ErisDS
Copy link
Member

ErisDS commented Oct 2, 2013

Can we have a markdown label, so we can track all of these? The markdown mode in CodeMirror is so different to the regex parser we use in showdown, the best way to fix all these is going to be to unify them.

@sebgie
Copy link
Contributor

sebgie commented Oct 2, 2013

The first problem ('ddddddd') is caused by Github flavored markdown (gfm.js: line 66). It matches a hex number with more than 7 characters. Is Github flavor needed?

@sebgie
Copy link
Contributor

sebgie commented Oct 2, 2013

Second problem is codemirror behaviour where it interprets the first [every ... world] as a broken link.

@JohnONolan
Copy link
Member Author

@ErisDS You will see we have an "editor" label already to track all of these ;)

@ErisDS
Copy link
Member

ErisDS commented Oct 2, 2013

@JohnONolan lol when did that happen... but cool.

@sebgie, we are using certain features of gfm, like auto linking, so if we turn it off we lose features, and if we turn it on we get oddness like this.

With regards to [every ... world] being a broken link, it depends on the markdown spec, and your interpretation of it. In markdown [...] is the first part of a link. If you want to use this syntax in text you should escape it... @JohnONolan should have written \[every ... world\]. CodeMirror is entirely correct in determining this as a broken link. But I'll be the first person to say that this is a completely crap user experience.

We're absolutely pushing the boundaries of the markdown specification. We are using parts of the GFM spec, and we are in part defining our own 'Haunted Markdown' spec. At the moment, we're doing this using existing tools and it's absolutely not the best solution.

Long term we want to formalise our spec and build our own tools.
Short term we need to make decisions about where these issues are acceptable, and where we really need to fix them as best we can.

Unfortunately, I'm not sure there is any quick fixes for these issues without forking / writing our own CodeMirror mode, and even that is more of a 0.4 quick fix, as opposed to something we can hack in for 0.3.2.

@JohnONolan
Copy link
Member Author

#wontfix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects:editor Work relating to the Koenig Editor bug [triage] something behaving unexpectedly
Projects
None yet
Development

No branches or pull requests

3 participants