atom / language-gfm

GitHub Flavored Markdown in Atom
MIT License
101 stars 107 forks source link

Bad highlighting for empty inline preformatted snippets #238

Open mcandre opened 5 years ago

mcandre commented 5 years ago

Prerequisites

Description

When I use backticks to create preformatted code snippets, and the content is empty, then the syntax highlighing messes up.

Steps to Reproduce

  1. Insert two consecutive backticks in a GitHub flavored Markdown file.

Expected behavior:

The syntax highlighter correctly highlights the snippet as an empty inline section.

Actual behavior:

The syntax highlighter continues highlighting past the closing backtick, as if the rest of the file is an inline preformatted snippet, until a third backtick is found.

Reproduces how often:

100%

Versions

Atom : 1.35.1 Electron: 2.0.18 Chrome : 61.0.3163.100 Node : 8.9.3

apm 2.1.3 npm 6.2.0 node 8.9.3 x64 atom 1.35.1 python 2.7.15 git 2.18.0

Additional Information

macOS

rsese commented 5 years ago

Thanks for the report and for using the issue template :+1: Just to clarify, I assume you're referring to the syntax highlighting in the editor and not how things look in Markdown Preview (preview seems to render things ok with the empty code span)?

mcandre commented 5 years ago

I am referring to the syntax highlighting in the editor. I have not checked how the preview pane behaves for this edge case.

rsese commented 5 years ago

Thanks for confirming :+1: This package is for Markdown Preview, the Markdown syntax highlighting is provided by https://github.com/atom/language-gfm so I'll move this over since I didn't find an issue that seems to report this (though I might have missed it or it's already covered by an existing issue).

rsese commented 5 years ago

Thanks again - I thought this was reported before but couldn't quite find an exact duplicate. Reproduced on 1.35.1 with macOS 10.12.6 with:

# hello world

Testing empty inline code block `` here

## testing