PrismJS / prism

Lightweight, robust, elegant syntax highlighting.
https://prismjs.com
MIT License
12.28k stars 1.3k forks source link

clike comment pattern exec throwing error #363

Closed shannonmoeller closed 10 years ago

shannonmoeller commented 10 years ago

The following 'comment' token definition is causing an error to be thrown in tokenloop on var match = pattern.exec(str);:

Prism.languages.clike = {
    'comment': [
        {
            pattern: /(^|[^\\])\/\*[\w\W]*?\*\//g,
            lookbehind: true
        },
        {
            pattern: /(^|[^\\:])\/\/.*?(\r?\n|$)/g,
            lookbehind: true
        }
    ]
zeitgeist87 commented 10 years ago

Are you using the autolinker plugin? If so this could be related to #359. I already submitted a PR with a fix for that bug in #360.

shannonmoeller commented 10 years ago

That was the issue. Removed the plugin as a workaround. Thanks!