Skip to content

Commit

Permalink
Handle unspecified or unknown languages when editing code blocks
Browse files Browse the repository at this point in the history
Use markdown-edit-code-block-default-mode for indirect editing when no
language name is given or when a suitable mode cannot be determined.

Closes GH-284
  • Loading branch information
jrblevin committed Nov 14, 2017
1 parent e3e7069 commit 78b6928
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@
features. ([GH-222][])
- Fix font-lock for inline code inside italics and bold.
([GH-275][])
- Make code block language detection handle unspecified
or unknown code block languages. ([GH-284][])

[gh-171]: https://github.com/jrblevin/markdown-mode/issues/171
[gh-216]: https://github.com/jrblevin/markdown-mode/issues/216
Expand Down Expand Up @@ -97,6 +99,7 @@
[gh-275]: https://github.com/jrblevin/markdown-mode/issues/275
[gh-276]: https://github.com/jrblevin/markdown-mode/issues/276
[gh-277]: https://github.com/jrblevin/markdown-mode/pull/277
[gh-284]: https://github.com/jrblevin/markdown-mode/issues/284

# Markdown Mode 2.3

Expand Down
5 changes: 2 additions & 3 deletions markdown-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -9182,9 +9182,8 @@ position."
(end (and bounds (goto-char (nth 1 bounds)) (point-at-bol 1))))
(if (and begin end)
(let* ((lang (markdown-code-block-lang))
(mode (if lang
(markdown-get-lang-mode lang)
markdown-edit-code-block-default-mode))
(mode (or (and lang (markdown-get-lang-mode lang))
markdown-edit-code-block-default-mode))
(edit-indirect-guess-mode-function
(lambda (_parent-buffer _beg _end)
(funcall mode))))
Expand Down

0 comments on commit 78b6928

Please sign in to comment.