Jade: Links inside a paragraph

后端 未结 13 1949
野趣味
野趣味 2020-12-07 17:34

I\'m trying to author a few paragraphs with Jade, but finding it difficult when there are links inside a paragraph.

The best I can come up with, and I\'m wondering

13条回答
  •  遥遥无期
    2020-12-07 18:00

    You can use a markdown filter and use markdown (and allowed HTML) to write your paragraph.

    :markdown
      this is the start of the para.
      [a link](http://example.com)
      and this is the rest of the paragraph.
    

    Alternatively it seems like you can simply ouput HTML without any problems:

    p
      | this is the start of the para.
      | a link
      | and this is he rest of the paragraph
    

    I wasn't aware of this myself and just tested it using the jade command line tool. It seems to work just fine.

    EDIT: It seems it can actually be done entirely in Jade as follows:

    p
      | this is the start of the para  
      a(href='http://example.com;) a link
      |  and this is the rest of the paragraph
    

    Don't forget an extra space at the end of para (although you can't see it. and between | and. Otherwise it will look like this para.a linkand not para a link and

提交回复
热议问题