bitmark-standard / bitmark-grammar

7 stars 0 forks source link

Square brackets in book bit #3

Open stefanszasz opened 1 year ago

stefanszasz commented 1 year ago

Currently, a book bit containing square brackets is not parsed properly. Eg:

[.book]
[#My book title [Text in brackets]]

Returns:

[
    {
        "bitmark": "[.book]\n[#My book title [Text in brackets]]",
        "bit": {
            "type": "book",
            "format": "bitmark--",
            "body": "My book title [Text in brackets]]",
            "item": "",
            "hint": "",
            "isExample": false,
            "example": "",
            "title": ""
        },
        "errors": [
            {
                "message": "Unexpected input '[#My book title [Text'",
                "line": 2,
                "column": 16,
                "errorLine": "[#My book title [Text in brackets]]"
            },
            {
                "message": "Unexpected input ']'",
                "line": 2,
                "column": 34,
                "errorLine": "[#My book title [Text in brackets]]"
            }
        ]
    }
]

The result should have the .title set to My book title [Text in brackets]

Reproduced with v1.0.35