-
Notifications
You must be signed in to change notification settings - Fork 167
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
Failed to detect fenced code block when there are some parameters after language's name. #184
Comments
You can edit May I ask which Markdown processor you are using? Does GFM, for example, handle this? |
I have set my init.el as (use-package markdown-mode
:ensure t
:commands (markdown-mode gfm-mode)
:mode (("README\\.md\\'" . gfm-mode)
("\\.md\\'" . markdown-mode)
("\\.markdown\\'" . markdown-mode))
:init
(setq markdown-command "multimarkdown")
(setq markdown-regex-gfm-code-block-open
"^[[:blank:]]*\\(```\\)[ ]?\\([^[:space:]]+\\|{[^}]*}\\)?\\([[:ascii:]]*?\\)$")) but with no luck. Not sure if this is the right way to edit the variable? We use ornate to process our markdown files. |
@jrblevin Any further suggestions? |
Looks like ornate is based on CommonMark, which does indeed allow spaces in the language identifier. It treats the first "word" in the expression as the language name, as in your example. I'm fine if we allow the regular expression to be more inclusive to allow this, however, it turns out that it's not as simple as changing the regex. The second matching group is also used to parse the buffer for language names, so we need to add a new group to separate the language name (first "word") from the rest and then update the language name parsing code and font lock code. You may be able to get by for now by just editing the |
We are using an extended fenced code block syntax that there will be some parameters after the language's name.
And this breaks the syntax highlight after this code block. Seems like it is taking the last three backticks in the above example as a beginning of a new code block and highlight all the things after it in a single color.
Any suggestions on how to support this syntax? I can try to tweak it in my emacs but not sure how to start? (Sorry I'm not that familiar with Elisp.)
The text was updated successfully, but these errors were encountered: