js-markdown-extra icon indicating copy to clipboard operation
js-markdown-extra copied to clipboard

Infinite loop in code block

Open jdecool opened this issue 11 years ago • 0 comments

I've made an copy/paste text from Github markdown.

There's an infinite loop with this text :

```php
function test() { echo "test".$2; };
``

You can reproduce with this (incomplete) test :

QUnit.test("Bug infinite loop", function() {
    var input =
        '```php' + "\n" +
        'function test() { echo "test".$2; }' + "\n" +
        '``' + "\n" +
        "";

    var expected =
        "";

    var result = Markdown(input); // infinite loop
    QUnit.assert.equal(result, expected);
});

Edit: this bug is only for Chrome and Node

jdecool avatar Jul 25 '14 12:07 jdecool