wiki2adf: Empty list can be dropped instead of rendering as asterisk paragraph

Issue #27 closed
Chris Fuller created an issue

Example 1

Input Wiki

*


*

Expected ADF

{
    "type": "doc",
    "version": 1,
    "content": [
        {
            "type": "paragraph",
            "content": [
                {
                    "type": "text",
                    "text": "*"
                }
            ]
        },
        {
            "type": "paragraph",
            "content": [
                {
                    "type": "text",
                    "text": "*"
                }
            ]
        },
    ]
}

Actual ADF

{
    "type": "doc",
    "version": 1,
    "content": [
        {
            "type": "paragraph",
            "content": [
                {
                    "type": "text",
                    "text": "*"
                }
            ]
        }
    ]
}

Explanation

When followed by one or more newlines, the asterisk is discarded instead of rendered as a paragraph. If it is at the very end of the document, then it is correctly included.

Example 2

Input Wiki

(Same as Example 1, but with 2 trailing newlines that the editor won’t let me keep, here.)

Expected ADF

(Same as Example 1)

Actual ADF

{
    "type": "doc",
    "version": 1,
    "content": [
        {
            "type": "paragraph"
        }
    ]
}

Explanation

With the trailing newlines, it gets the same incorrect handling that drops the asterisk instead of including it as paragraph text, with the result that we get nothing but an empty paragraph.

Comments (3)

  1. Log in to comment