Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YAML strings fail with trailing comments #1601

Closed
Chris-Johnston opened this issue Oct 29, 2018 · 0 comments
Closed

YAML strings fail with trailing comments #1601

Chris-Johnston opened this issue Oct 29, 2018 · 0 comments

Comments

@Chris-Johnston
Copy link
Contributor

Summary

YAML string highlighting does not work when a string has a comment on the same line.

Example

Using the following example:

<html>
    <head>
        <link href="prism.css" rel="stylesheet" />
    </head>
    <body>
        <script src="prism.js"></script>
        <pre>
            <code class="language-yaml">
hello:
    - "world" # test
    - "world"
            </code>
        </pre>
    </body>
</html>

I'm testing this using version 1.15.0, from this link: https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript+yaml

Chris-Johnston added a commit to Chris-Johnston/prism that referenced this issue Oct 29, 2018
Updates the string regex to allow for strings that may have a trailing '#'.
This uses a different pattern from other regex patterns, because only
the string regex pattern is greedy, while the others are not.
mAAdhaTTah pushed a commit that referenced this issue Oct 29, 2018
Updates the string regex to allow for strings that may have a trailing '#'.
This uses a different pattern from other regex patterns, because only
the string regex pattern is greedy, while the others are not.

Fix #1601.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant