github.com/servernoj/jade@v0.0.0-20231225191405-efec98d19db1/testdata/v2/interpolation.jade (about)

     1  
     2  - var title = "On Dogs: Man's Best Friend";
     3  - var author = "enlore";
     4  - var theGreat = "<span>escape!</span>";
     5  
     6  h1= title
     7  p Written with love by #{author}
     8  p This will be safe: #{theGreat}
     9  
    10  
    11  - var msg = "not my inside voice";
    12  p This is #{strings.ToUpper(msg)}
    13  
    14  
    15  p No escaping for #{`}`}!
    16  
    17  
    18  p Escaping works with \#{interpolation}
    19  p Interpolation works with #{'#{interpolation}'} too!
    20  
    21  
    22  - var riskyBusiness = "<em>Some of the girls are wearing my mother's clothing.</em>";
    23  .quote
    24    p Joel: !{riskyBusiness}
    25  
    26  
    27  p.
    28    This is a very long and boring paragraph that spans multiple lines.
    29    Suddenly there is a #[strong strongly worded phrase] that cannot be
    30    #[em ignored].
    31  p.
    32    And here's an example of an interpolated tag with an attribute:
    33    #[q(lang="es") ¡Hola Mundo!]
    34  
    35  
    36  p
    37    | If I don't write the paragraph with tag interpolation, tags like
    38    strong strong
    39    | and
    40    em em
    41    | might produce unexpected results.
    42  p.
    43    If I do, whitespace is #[strong respected] and #[em everybody] is happy.
    44