Skip to content

The Markdown support works poorly with nested markups #919

Open
@ParadoxV5

Description

@ParadoxV5

(rdoc --version: 6.4.0)

RDoc (and by extension, YARD out-of-the-box) has Markdown support, but it doesn’t work correctly when it comes to nested emphasis/strong text, in-line code and links.

Refer to the sample I’ve provided. I’ve included both popular style (backtick for code, square-round brackets for link) and RDoc style (plus for code, curly-square for link).

Input
*`1_tick`*

*+1_plus+*

`*tick_1*`

+*plus_1*+

**`2_tick`**

**+2_plus+**

`**tick_2**`

+**plus_2**+

[*square_1*](https://example.org)

{*curly_1*}[https://example.org]

*[1_square](https://example.org)*

*{1_curly}[https://example.org]*

[**square_2**](https://example.org)

{**curly_2**}[https://example.org]

**[2_square](https://example.org)**

**{2_curly}[https://example.org]**

[`square_tick`](https://example.org)

{`curly_tick`}[https://example.org]

`[tick_square](https://example.org)`

`{tick_curly}[https://example.org]`

[+square_plus+](https://example.org)

{+curly_plus+}[https://example.org]

+[plus_square](https://example.org)+

+{plus_curly}[https://example.org]+
Expected (formatted in GitHub Markdown)

1_tick

1_plus

*tick_1*

*plus_1*

2_tick

2_plus

**tick_2**

**plus_2**

square_1

curly_1

1_square

1_curly

square_2

curly_2

2_square

2_curly

square_tick

curly_tick

[tick_square](https://example.org)

{tick_curly}[https://example.org]

square_plus

curly_plus

[plus_square](https://example.org)

{plus_curly}[https://example.org]

Actual (copy-pasted verbatim from output HTML’s source)

1_tick

1_plus

tick_1

+plus_1+

2_tick

2_plus

tick_2

+plus_2+

{square_1}

{curly_1}

{1_square}[https://example.org]

{1_curly}[https://example.org]

{square_2}

{curly_2}

{2_square}[https://example.org]

{2_curly}[https://example.org]

{square_tick}

{curly_tick}

[tick_square](https://example.org)

{tick_curly}[https://example.org]

{square_plus}

{curly_plus}

+plus_square+

+plus_curly+

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions