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.

Splitting arrays/objects over code blocks breaks syntax highlighting #160

@nathancarter

Description

@nathancarter

Description

In literate mode, splitting an array or object over more than one code block breaks syntax highlighting as shown below.

Steps to Reproduce

  1. Create a new file.
  2. Save it with the .litcoffee extension.
  3. Enter the code below.
Some documentation, highlighted correctly.

    myArray = [
        'item1'

Some documentation, highlighted as code. :(

        'item2'
        'item3'
    ]

Things are still not right.

Expected behavior: Text without indentation should always be treated and highlighted as Markdown, never mistaken for Coffeescript code. GitHub highlights it incorrectly as well, as you can see immediately above.

Actual behavior: The following screenshot shows that the syntax highlighter has begun to treat unindented code as if it were Coffeescript code.

screen shot 2017-10-25 at 10 38 58 am

The same behavior occurs with objects instead of arrays, as shown below.

Some documentation, highlighted correctly.

    myObject = {
        'item1' : 1

Some documentation, highlighted as code. :(

        'item2' : 2
        'item3' : 3
    }

Things are still not right.

screen shot 2017-10-25 at 10 42 19 am

According to this page, it seems like the GitHub syntax highlighting is actually handled by this package (atom/language-coffee-script), which is a little surprising to me, since there have been differences in the past on how the two behave, but perhaps this is a recent change? If need be, I'm glad to file an issue in the appropriate other repo so that the issue is fixed on GitHub also.

Reproduces how often: 100%

Versions

Atom : 1.21.0

Electron: 1.6.9

Chrome : 56.0.2924.87

Node : 7.4.0

Mac OS X 10.11.6

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions