Skip to content

Quote in JavaScript regex breaks highlighting #54

@verhovsky

Description

@verhovsky

Syntax highlighting this JavaScript file

  attribute: function(str) {
    var quote = '';
    var quoteRe = /['"]/;
    var key = '';
    var i;

    // consume all whitespace before the key
    for (i = 0; i < str.length; i++) {
      if (!this.whitespaceRe.test(str[i])) break;
      if (str[i] === '\n') {
        this.incrementLine(1);
      } else {
        this.incrementColumn(1);
      }
    }

breaks because of the quote in the regex /['"]/;:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions