Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Better support for info strings in fenced code blocks containing more than just the language #199

@fasiha

Description

@fasiha

Prerequisites

Better support for info strings in fenced code blocks containing more than just the language

If I start a fenced code block, and add an info string like py, the fenced code block will be highlighted as Python. So far so good. But if I make it py base.py, e.g., Atom stops formatting the code block as Python because language-gfm parses the entire info string, including trailing characters, as the language name (a guess).

Consider interpreting the info string’s text only up to the the first whitespace/punctuation as the language specifier?

Steps to Reproduce

  1. Create a fenced code block with ticks.
  2. Add a language specification to after the opening triplet and confirm that the code is highlighted as that language
  3. Add a space and some more text.

Expected behavior: The code block retains the syntax highlighting

Actual behavior: The code block is shown as a plain codeblock as if it lacked an info string

Reproduces how often: 100%

Versions

Atom:

Atom    : 1.16.0
Electron: 1.3.13
Chrome  : 52.0.2743.82
Node    : 6.5.0

apm:

apm  1.16.1
npm  3.10.5
node 6.9.5 x64
python 2.7.13
git 2.9.2

macOS Sierra.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions