Markdown Mode 2.2 Release Notes
Markdown Mode for Emacs version 2.2 was released on May 26, 2017. This is a major new stable release and all users are encouraged to upgrade. The many new features and bug fixes included are described below. See the Git repository or the commit-specific links below for a detailed history of changes. Thanks to everyone who submitted bug reports, feature suggestions, and especially patches.
Additionally, to celebrate Markdown Mode’s 10th birthday I am writing a Guide to Markdown Mode for Emacs. This ebook will supplement the existing documentation with in-depth discussion of advanced movement and editing commands, configuration examples, tips and tricks, and a survey of other packages that work with Markdown Mode. It will be published at Leanpub and possibly available through other channels. Please visit the book homepage to sign up to be notified when it is ready and to help determine the price.
General
- Menubar reorganization. Grouped related actions together, added missing commands, and added several toggle options to the menu.
- Use
toggle
menu style for macOS compatibility. - Remove autoload .text files. Thanks to Steve Purcell.
- Don’t accidentally override user entries in
auto-mode-alist
. - Customizable preview window split direction via
markdown-split-window-direction
.
Element Insertion and Editing
- Now use C-c C-j for inserting list items, like AUCTeX and
similar to other programming modes. Since C-c C-j was
used for
markdown-jump
(for moving between reference link/footnote markers and their definitions), it has been changed to C-c C-l (think “leap” or “loop” instead of jump). It’s also close to C-c C-o (used for opening links). - Insertion of
<kbd>
tags with C-c C-s k ormarkdown-insert-kbd
. - Complete heading markup when point is on an setext heading and
markdown-insert-header-dwim
is invoked (C-c C-t h). - Fix
markdown-cycle
issue with heading-like strings in code blocks. Thanks to Syohei Yoshida. - Fix to honor location setting when inserting reference definitions.
- Don’t insert empty title strings for links. Thanks to Sebastian Wiesner for the patch.
- Inserting a reference link no longer causes an “args out of range” commit error when the existing reference label is a single commit character.
- Fix point position after inserting asymmetric atx headings.
- Backspace now always deletes characters if a region is specified.
Indentation and Filling
- Set own
adaptive-fill-regexp
so thatfill-paragraph
works for list items. Thanks to Syohei Yoshida for the patch. - Maintain cursor position when indenting instead of moving to the beginning of the line. Thanks to Isaac Hodes.
- Ignore heading lines in
fill-paragraph
. Thanks to Syohei Yoshida. - Fixed an issue where fill paragraph wouldn’t work following unclosed left square brackets.
fill-paragraph
now respects paragraph boundaries within blockquotes.- Prevent
fill-paragraph
from filling lines in code blocks. - Added option to automatically continue lists when
RET
is pressed.markdown-indent-on-enter
now has three settings
Movement Functions
- Fix moving same level heading over code block issue. Thanks to Syohei Yoshida.
- Set mark when calling
markdown-up-heading
. - Add smart Markdown block navigation commands M-{ and M-}. These replace the regular-expression-based “paragraph” movement commands provided by Emacs, which do not recognize Markdown syntax (e.g., headings inside of code blocks). Also use M-h for marking a block and C-x n b to narrow to a block.
Font Lock
- Variable-height headings via
markdown-header-scaling
. - Improved font locking after empty GFM code block insertion.
- Fix italic highlighting issue when each line or both lines are list.
- Handle false positive italics across list items.
- Respect
font-lock-mode
being nil. - Treat polymode blocks as code blocks when parsing the buffer.
- Add YAML metadata parsing. Also allow multiple Pandoc metadata, with tests. Thanks to Danny McClanahan.
- Improved fenced code block parsing. Thanks to Danny McClanahan.
- Move point at least 1 char in
markdown-match-propertized-text
to avoid possible infinite loop in font-lock. Thanks to Vitalie Spinu. - Fixed an issue where comments of the form
<!-- > comment -->
were not correctly identified. - Require whitespace atx heading hashmarks, as required by the original atx specification (but not enforced by Markdown.pl). The benefit is that it prevents false positives for #hashtags and things like “Engine #1” when lines wrap.
- Prevent spurious bold fontification. Thanks to Kévin Le Gouguec.
- Fix spurious italics from underscores in URLs.
- Support basic TOML metadata. Thanks to Jorge Israel Peña.
- Keep metadata visible when cycling visibility.
- Prohibit setext heading text from starting with hyphens, spaces or tabs, so that there is no ambiguity between setext headings and in-progress lists.
- Fix
markdown-header-face
inherit from nil error, e.g., when exporting HTML from an Org mode file containing a Markdown source block. Thanks to Moogen Tian for a patch. - Only call
font-lock-refresh-defaults
iffont-lock-mode
is non-nil to prevent it from being turned on when disabled by user. Thanks to Tom May for the patch. - Fixed an issue where, if there is special markup at the end of the buffer, deleting a character backward would cause the font-lock faces to disappear.
- Fixed font lock for links with URLs containing parentheses.
Imenu
- Added a
markdown-nested-imenu-heading-index
as a customizable option. It may be disabled to instead generate a flat imenu index. A flat index may be more useful for keyboard navigation and auto-completion, while a nested index is probably more useful for menus and for use with packages such asimenu-list
. - Don’t list heading-like lines in code blocks. Thanks to Syohei Yoshida.
Fenced Code Blocks
- Add used language names to front of list of known languages.
- Fix default language presented when inserting GFM code blocks. Thanks to Conal Elliot for a patch.
- Match fenced code blocks with language and info strings.
Preview & Export
- Suppress minibuffer output when generated HTML is small. Thanks to Syohei Yoshida.
- Make live-preview mode follow min or max point. Thanks to Danny McClanahan.
Images
- Implement inline image previews via
markdown-toggle-inline-images
and C-c C-i C-t. Thanks to Syohei Yoshida.
Links
- Change the behavior of C-c C-o
(
markdown-follow-link-at-point
) so that if a link is a complete URL, it will open in a browser. Otherwise, open it withfind-file
after stripping anchors and/or query strings.
Lists
- Basic font lock and filling for definition lists. As a side effect, list item navigation and movement should also work.
- Fix list item insertion on ordered lists with hash marks (Pandoc “fancy lists”).
- Add command for toggling GFM task list items via C-c C-c
C-x (
markdown-toggle-gfm-checkbox
).
Wiki Links
- Ability to toggle wiki link support via a new custom variable
markdown-enable-wiki-links
. This may be set in a file local variable. Also added functionmarkdown-toggle-wiki-links
and a menu item. - Make font lock for missing wiki links optional and disabled by
default. Add new custom variable
markdown-wiki-link-fontify-missing
to control this behavior. - Added
markdown-wiki-link-search-subdirectories
to enable searching for wiki link files in subdirectories.
Math Support
- The function
markdown-enable-math
has been made obsolete and renamed tomarkdown-toggle-math
. When called without an argument, the result is to toggle this extension rather than enable it. This is motivated by the behavior of minor mode functions. - Improve matching of multiple math blocks with non-math text in between. Thanks to Dave Kleinschmidt for a patch.
- Fix incorrect matching of italic text due to underscores in math mode. Thanks also to Dave Kleinschmidt.
Other Improvements & Fixes
- Fix possible infinite loop in
markdown-cleanup-list-numbers
. Thanks to Danny McClanahan. - Fix an args-out-of-range error due to the syntax-propertize function
returning point which is larger than
point-max
. Thanks to Syohei Yoshida. - Respect narrowed region in
markdown-find-previous-prop
. Thanks to Vitalie Spinu. - Fix an issue where buffers could be marked as modified when no modifications were made.
- Markdown Mode is now automatically tested against Emacs 24.1–24.5 and 25.1–25.2.