Skip to content

(Elixir) Apostrophe code point character literal syntax (?') comments out the rest of the code #4238

@codingthat

Description

@codingthat

Describe the issue
If you use the legitimate sequence ?' to represent the code point of the apostrophe character in Elixir code, highlight.js treats everything after the ' as a comment:

Image

Which language seems to have the issue?

elixir

Are you using highlight or highlightAuto?

highlight

Sample Code to Reproduce

defmodule Acronym do
  defguardp apostrophe?(c) when c == ?'
  defguardp upper?(c) when (c >= ?A and c <= ?Z)
end

...as seen at https://jsfiddle.net/5gkn4hyw/

Expected behavior
The code after the ?' sequence should continue to highlight normally. (Above, GitHub gets it right.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions