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

Markdown highlighting doesn't work as it should #13375

Open
core-ai-bot opened this issue Aug 31, 2021 · 7 comments
Open

Markdown highlighting doesn't work as it should #13375

core-ai-bot opened this issue Aug 31, 2021 · 7 comments

Comments

@core-ai-bot
Copy link
Member

Issue by mkoske
Saturday Sep 12, 2015 at 13:47 GMT
Originally opened as adobe/brackets#11691


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.

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Saturday Sep 12, 2015 at 16:29 GMT


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.

@core-ai-bot
Copy link
Member Author

Comment by mkoske
Saturday Sep 12, 2015 at 18:47 GMT


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.

@core-ai-bot
Copy link
Member Author

Comment by petetnt
Sunday Sep 13, 2015 at 09:57 GMT


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

@core-ai-bot
Copy link
Member Author

Comment by petetnt
Sunday Sep 13, 2015 at 10:05 GMT


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

@core-ai-bot
Copy link
Member Author

Comment by mkoske
Sunday Sep 13, 2015 at 10:13 GMT


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.

@core-ai-bot
Copy link
Member Author

Comment by russianhun
Saturday Jan 27, 2018 at 19:15 GMT


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?

@core-ai-bot
Copy link
Member Author

Comment by russianhun
Saturday Jan 27, 2018 at 19:17 GMT


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 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

1 participant