Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Markdown highlighting doesn't work as it should #11691

Open
ghost opened this issue Sep 12, 2015 · 7 comments
Open

Markdown highlighting doesn't work as it should #11691

ghost opened this issue Sep 12, 2015 · 7 comments

Comments

@ghost
Copy link

ghost commented Sep 12, 2015

Hello,

I have been trying to ask this on IRC, but I'll write my question here too.

So, why Markdown syntax highlighting is not working? In Codemirror, when you surround text with - for example - two asterisks to make text bold, it becomes bold, but when doing same in Brackets, it has no effect.

See Markdown-mode demo here:
http://codemirror.net/mode/markdown/index.html

I write a lot using Markdown and I would like to have proper syntax highlighting for it.

@redmunds
Copy link
Contributor

You could create a Language in Brackets to use the CodeMirror mode, but I prefer using the Markdown Preview extension to see both the raw and formatted text at the same time.

@ghost
Copy link
Author

ghost commented Sep 12, 2015

I have Markdown Preview -extension installed, but I want also proper highlighting while writing.

I got it partially solved by installing Brackets Themes -extension and choosing theme right theme. So it seems to be theme problem partially. But then, if I hard-wrap words, the highlighting breaks, at least with lists so it's not problem only with theme.

@petetnt
Copy link
Collaborator

petetnt commented Sep 13, 2015

I agree with @mkoske here, I wonder why Brackets doesn't add syntax highlighting to Markdown formatting when all the other Codemirror Markdown editors seem to do it? I use Markdown Preview too, but raw markdown should receive the syntax highlighting styles:

As in

**hello world** should show up in editor as

image

instead of

image

@petetnt
Copy link
Collaborator

petetnt commented Sep 13, 2015

Oh, it's a bug:

See brackets_codemirror_overrides.less

/*
 * Temporarily override bold and italic syntax highlighting until
 * SourceCodePro supports them in a fixed pitch
 */
span.cm-em {
    font-style: normal;
}
span.cm-header, span.cm-strong {
    font-weight: normal;
}
span.cm-emstrong {
    font-style: normal;
    font-weight: normal;
}

Not sure if it has been fixed yet, the bolded letters seem to be very blurry but italics look okay?

image

@redmunds made that change back in 2012

@ghost
Copy link
Author

ghost commented Sep 13, 2015

I use Ttcn theme, and it works to some extent, e.g. I get bold text and italics too. But when I try to have list with hard-wrapped text, like this:

- item 1
- item 2, which is long
  and is hard-wrapped and intended,
- and this is next item

highlighting breaks. Hard-wrapped lines and item after that are not highlighted correctly. It works on the Codemirror demo-page I linked to in my first message.

So there's a bug somewhere.

@attilaoroszdev
Copy link

I see this issue is closed for years, yet none of the problems seem to have been solved. I came here searching for a solution to this exactly. Ended up having to manually override the codemirror overrides mentioned above for bold and italic items to correctly display in the editor. It does look good now, with no fuzziness so I guess this was an oversight?

@attilaoroszdev
Copy link

Sorry, my bad, don't know why I saw "closed" written on a green background... :) Anyway, this should be easy enough to solve now...

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

No branches or pull requests

4 participants
@redmunds @attilaoroszdev @petetnt and others