Skip to content

gfm-mode does not treat no newline here correctly #403

@tarsius

Description

@tarsius

Expected Behavior

Given

`one`
``two``
```three```

gfs-mode should only set the invisible property to markdown-markup for all the backquotes but not for any of the other characters.

Actual Behavior

The invisible property is also set to markdown-markup for the three part. (As expected that is not done for the one and two parts.) At least for gfm-mode, strings that do not contain any newline characters and that are delimited with three backquotes on both sides should be treated the same as such strings are when they have only one or two backquotes on both sides.

I don't know whether using three backquotes that way is valid for official markdown, but it is for gfm.

Note that the three part above does not serve the same purpose as the language part below.

```language
content
```

The language part is markup; the three part is not.

Steps to Reproduce

  1. Copy the above first code-block above into a gfm-mode buffer.
  2. Depending on how you did the copying, the three lines may begin with newline characters. If so, then remove those.
  3. Evaluate (add-to-invisibility-spec 'markdown-markup) in that buffer.
  4. Watch three become invisible but not two or one.

Software Versions

Latest markdown-mode commit (115f77d).

Emacs and OS versions are irrelevant.

Other information

This is in reference to magit/forge#45.

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