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

Font-locking code blocks #185

Closed
xiongtx opened this issue Apr 5, 2017 · 6 comments
Closed

Font-locking code blocks #185

xiongtx opened this issue Apr 5, 2017 · 6 comments

Comments

@xiongtx
Copy link
Contributor

xiongtx commented Apr 5, 2017

Expected behavior

There should be a way to font-lock code blocks for supported languages, similar to Orgmode's org-src-font-lock-fontify-block.

This may be particular to gfm-mode.

Actual behavior

There is no such feature.

Steps to reproduce (recipe)

N/A

Backtraces if some (M-x toggle-debug-on-error)

N/A

Versions of markdown-mode, Emacs, OS, etc.

  • markdown-mode: 2.1
  • Emacs: 25.1.50.1
  • OS: Darwin C02RW05YFVH6 15.6.0
@Fuco1
Copy link
Contributor

Fuco1 commented Apr 11, 2017

I've actually come looking for exactly this feature.

This is extremly simple to implement, I've done it for sphinx: https://github.com/Fuco1/sphinx-mode/blob/master/sphinx-src.el The code could be copied 1:1 or extracted as an extra dependency.

@jrblevin
Copy link
Owner

jrblevin commented Jun 8, 2017

Thanks for the pointer @Fuco1! I have something working and hope to push it soon...

screen shot 2017-06-08 at 11 03 09 am

@jrblevin
Copy link
Owner

jrblevin commented Jun 8, 2017

This is in the master branch now. The main commit is 76ccd82. It's disabled by default, but set markdown-fontify-code-blocks-natively to t and reload to see it. I'll add a toggle key and command soon...

@jrblevin
Copy link
Owner

jrblevin commented Jun 8, 2017

Update:

@jrblevin jrblevin closed this as completed Jun 8, 2017
@jrblevin
Copy link
Owner

jrblevin commented Jun 8, 2017

I closed this accidentally, but I'll leave it that way for now. Let me know if you have any other comments or if anything doesn't work right.

@jrblevin
Copy link
Owner

Update: With 740bd6a, native fontification works for tilde-fenced code blocks too.

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

No branches or pull requests

3 participants