Skip to content

Links with more than 6 pairs of parenthesis aren't parsed correctly #896

@JulianGmp

Description

@JulianGmp

Hi there,

I'm working with URIs that contain rison encoded data, which uses parenthesis for serializing json-like objects and arrays.

This can lead to URIs such as this one.

While it looks kind of odd, it's still a valid URI as far I can tell.
However, when I tried putting this into a mdbook, it simply rendered the markdown line as text.

Example input:

[1](https://rust.org/something%3A())  
[2](https://rust.org/something%3A(()))  
[3](https://rust.org/something%3A((())))  
[4](https://rust.org/something%3A(((()))))  
[5](https://rust.org/something%3A((((())))))  
[6](https://rust.org/something%3A(((((()))))))  
[7](https://rust.org/something%3A((((((())))))))  
[8](https://rust.org/something%3A(((((((()))))))))  
[9](https://rust.org/something%3A((((((((())))))))))  
[10](https://rust.org/something%3A(((((((((()))))))))))  
[11](https://rust.org/something%3A((((((((((())))))))))))  
[12](https://rust.org/something%3A(((((((((((()))))))))))))  
[13](https://rust.org/something%3A((((((((((((())))))))))))))  
[14](https://rust.org/something%3A(((((((((((((()))))))))))))))  

pulldown_cmark::html::push_html's output:

<p><a href="https://rust.org/something%3A()">1</a><br />
<a href="https://rust.org/something%3A(())">2</a><br />
<a href="https://rust.org/something%3A((()))">3</a><br />
<a href="https://rust.org/something%3A(((())))">4</a><br />
<a href="https://rust.org/something%3A((((()))))">5</a><br />
<a href="https://rust.org/something%3A(((((())))))">6</a><br />
[7](https://rust.org/something%3A((((((())))))))<br />
[8](https://rust.org/something%3A(((((((()))))))))<br />
[9](https://rust.org/something%3A((((((((())))))))))<br />
[10](https://rust.org/something%3A(((((((((()))))))))))<br />
[11](https://rust.org/something%3A((((((((((())))))))))))<br />
[12](https://rust.org/something%3A(((((((((((()))))))))))))<br />
[13](https://rust.org/something%3A((((((((((((())))))))))))))<br />
[14](https://rust.org/something%3A(((((((((((((()))))))))))))))</p>

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