Open fasiha opened 7 years ago
Same here in Atom 1.26.0 on macOS, even in Safe Mode.
Example code listing ````markdown # fenced code block without arguments ```js const x = 42; // highlighting works ``` # fenced code block with arguments ```js {something=something} const x = 42; // no highlighting here ``` ````
Looks like the same code is used to highlight stuff on Github. Check out these examples:
```js
const x = 42;
↓
```js
const x = 42;
ok
```js {something=something}
const x = 42;
↓
```js {something=something}
const x = 42;
ok
````markdown
# fenced code block without arguments
```js
const x = 42;
const x = 42;
↓
# fenced code block without arguments
```js
const x = 42;
const x = 42;
_highlighting inside ` ```js {something=something}` does not happen_
If I manage to fix this, would the change propagate to GitHub.com? I'd like to get online highlighting working [in this README](https://github.com/gicentre/litvis/blob/2ba014df51700010cc52f5626f85ac78842cfc7f/documents/README.md).
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 itpy 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
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:
apm:
macOS Sierra.