smaili
smaili

Reputation: 1235

Jade Template HTML Bracket Apostrophe and Multiline Issues

There's a couple of issues I'm experiencing when I use the #[] syntax for HTML tags.

Here's the two issues I'm experiencing:

  1. Using an apostrophe

    p.
        #[strong John's strong text] is really strong.
    

    Error message:

    The end of the string was reached with no closing bracket found.]

  2. Using multiple lines

    p.
        #[strong This strong text is really really long. This strong
        text is really really long. This strong text is really really
        long.]
    

    Error message:

    The end of the string was reached with no closing bracket found.]

I've tried solving both problems by adding \ but no luck.

Upvotes: 1

Views: 809

Answers (3)

Matias Kinnunen
Matias Kinnunen

Reputation: 8540

2021 update

According to GitHub issue #1723:

  • Case 1 was a bug that has been fixed in Pug 2.0.0 (released in 2018).

  • Case 2 is intentional because "it's really not clear exactly what that would mean in terms of indentation." This is suggested as an alternative:

    p
      strong.
        This strong text is really really long. This strong
        text is really really long. This strong text is really really
        long.
    

Upvotes: 0

JPritchard9518
JPritchard9518

Reputation: 192

You can replace ' with

'

to get rid of the error. So to answer 1. you could do

#[strong John's strong text] and it should work as expected.

Upvotes: 1

smaili
smaili

Reputation: 1235

For anybody stumbling on this, I've opened up an issue on Jade's GitHub because it turns out both 1 and 2 are currently not supported.

Link: https://github.com/jadejs/jade/issues/1723

Upvotes: 0

Related Questions