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

syntax highlighting for code #297

Open
ChillarAnand opened this issue Jul 2, 2015 · 10 comments
Open

syntax highlighting for code #297

ChillarAnand opened this issue Jul 2, 2015 · 10 comments

Comments

@ChillarAnand
Copy link

sx

it will be good if there is syntax highlighting for code.

@Malabarba
Copy link
Collaborator

There usually is, it's just a little hard to identify whether a block is code or text, and what language sould be used to highlight in that case. For instance, we don't yet check for language tags, we just use some reasonable heuristics.

Could you provide a link to that post so that we can figure out what to do?

@ChillarAnand
Copy link
Author

@Malabarba
Copy link
Collaborator

Ok thanks. This is indeed one of those cases that would be solved if we took question tags into consideration.
@vermiculus and I have been very busy lately, but I promise we'll get to it at some point!

@stardiviner
Copy link

Will it be slow if we toggle syntax highlight on big source code block?
Like Org-mode, it will slow down.

@Malabarba
Copy link
Collaborator

@stardiviner
No, it shouldn't be slow because we only perform syntax highlighting once (when the question buffer is first created), whereas typical major-modes usually have to do it on every redisplay.

@stardiviner
Copy link

I see. That's great.

@ylluminarious
Copy link
Contributor

Any progress on this? It seems like it should be fairly easy to implement and it would really help when reading posts that have a lot of code.

@vermiculus
Copy link
Owner

No progress as of yet that I'm aware of (both of us are very busy and really can only find the time for things we need at this moment), but pull requests are welcome!

@ylluminarious
Copy link
Contributor

@vermiculus Alright. Do you think you could give any advice on where to start for implementing this?

@vermiculus
Copy link
Owner

You're going to want to start around sx-question-mode--insert-markdown.

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

5 participants