Skip to content

Missing space after inline code spans in list items #428

@lionelplessis

Description

@lionelplessis

Description

ReverseMarkdown drops the separating space after inline code spans in some list-item scenarios.

For example, HTML like:

<li>The <code>label</code> text is mandatory:</li>
<li><code>AddItem</code> creates a new entry:</li>

is converted to Markdown like:

- The `label`text is mandatory:
- `AddItem`creates a new entry:

The expected Markdown is:

- The `label` text is mandatory:
- `AddItem` creates a new entry:

Minimal repro

using ReverseMarkdown;

var converter = new Converter(new Config
{
    GithubFlavored = true
});

var html = """
<li>The <code>label</code> text is mandatory:<ul><li><code>TryDeleteType()</code> returns <code>false</code></li></ul></li>
<li><code>AddItem</code> creates a new entry:<ul><li>default values</li><li>metadata</li></ul></li>
""";

Console.WriteLine(converter.Convert(html));

Actual output:

- The `label`text is mandatory:
- `TryDeleteType()` returns `false`
- `AddItem`creates a new entry:
- default values
- metadata

Expected output:

- The `label` text is mandatory:
- `TryDeleteType()` returns `false`- `AddItem` creates a new entry:
- default values
- metadata

Notes

This seems related to whitespace handling around inline <code> conversion in list-item contexts. I reproduced it with ReverseMarkdown 5.3.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions