Skip to content

markdown-insert-bold and other formatting, including space #613

@telephon

Description

@telephon

Expected Behavior

markdown-insert-bold and similar functions should always result in a legal formatting of the text, even if the selection/markers included a space at the beginning or end. [EDIT] This could be achieved by jumping to the next "legal" beginning of a formatting.

Actual Behavior

When selecting text to then do C-c C-s … (e.g. markdown-insert-bold), it easily happens that accidentally the selection begins with a space instead of the first character of the text. Then the text is not formatted, and one has to manually move the space outside.

Eg.

this is* a selection* of two words

this is *a selection* of two words

Steps to Reproduce

  1. select a string so that it begins with space
  2. hit C-c C-s b
  3. the resulting text is not bold.

Backtrace

Software Versions

markdown-mode, version 2.5-dev

GNU Emacs 27.1 (build 1, x86_64-apple-darwin18.7.0, NS appkit-1671.60 Version 10.14.6 (Build 18G95)) of 2020-08-12

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions