pugjs/pug-parser

Errors when using `#[]` syntax

Closed this issue · 1 comments

Both

p #[a.rho(href='#', class='rho--modifier') with inline link]

and

p Some text #[a.rho(href='#', class='rho--modifier')]

throw:

Uncaught Error: Unexpected token `end-jade-interpolation` expected `text`, `code`, `:`, `newline` or `eos`

But

p Some text #[a.rho(href='#', class='rho--modifier') with inline link]

does not

@ForbesLindesay thanks for the fix, but just noticed that I forgot to mention that line numbers and source files aren't reported for interpolated tags either. See:

{
    "type": "Tag",
    "name": "a",
    "selfClosing": false,
    "block": {
        "type": "Block",
        "nodes": []
    },
    "attrs": [{
        "name": "class",
        "val": "\'rho\'",
        "escaped": false
    }, {
        "name": "href",
        "val": "\'#\'",
        "escaped": true
    }, {
        "name": "class",
        "val": "\'rho--modifier\'",
        "escaped": true
    }],
    "attributeBlocks": [],
    "isInline": true,
    "line": 1
}