Skip to content

line highlighting: v3 matching algorithm will not match bare comments #1006

@teamdandelion

Description

@teamdandelion

Validations

Describe the bug

Consider the following python code snippet (I've substituted ' for ` for clarity)

'''python
# This comment is unimportant
# This comment is important, and should be highlighted! # [!code highlight]
'''

Or the following:

'''python{2}
# This comment is unimportant
# This comment is important, and should be highlighted!
'''

In the v3 algorithm, in both cases, it will not highlight the second line. Instead, it will append an extra # symbol at the end of the line.

Using the v1 algorithm, it correctly highlights both lines.

Reproduction

Included; see description

Contributes

  • I am willing to submit a PR to fix this issue
  • I am willing to submit a PR with failing tests

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions