asciidoctor / atom-language-asciidoc

⚛ AsciiDoc language package for the Atom editor.
https://atom.io/packages/language-asciidoc
MIT License
42 stars 20 forks source link

Some Ruby source breaks syntax colouring #175

Closed gquintana closed 7 years ago

gquintana commented 7 years ago

Description

In Ruby source block, something breaks syntax colouring.

Screenshots

image

Syntax example

#Ruby source Test

[source,ruby]
----
class Person
  def name            # <1>
    @name
  end
  def name=(new_name) # <2>
    @name=new_name
  end
end
----
<1> Declare a getter
<2> Declare a setter

Here the  syntax colouring is broken.
The single quote:  let's triggers something
gquintana commented 7 years ago

The # <2> in the Ruby source triggers the problem. Removing it solves the problem.

ldez commented 7 years ago

Thanks for reporting.

It's a problem with the Atom Ruby grammar package.

You can reproduce the bug with Markdown in Atom:

# Ruby source Test

\`\`\`ruby
class Person
  def name            # foo
    @name
  end
  def name=(new_name)  # foo
    @name=new_name
  end
end
\`\`\`

Here the  syntax colouring is broken.
The single quote:  let's triggers something

I use \ only to escape char in Github.

ldez commented 7 years ago

It's not a bug with Atom Langauge Asciidoc package but with Atom Ruby grammar package.