Jade: Links inside a paragraph

后端 未结 13 1956
野趣味
野趣味 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:01

    As of jade 1.0 there's an easier way to deal with this, unfortunately I can't find it anywhere in the official documentation.

    You can add inline elements with the following syntax:

    #[a.someClass A Link!]
    

    So, an example without going into multiple lines in a p, would be something like:

    p: #[span this is the start of the para] #[a(href="http://example.com") a link] #[span and this is the rest of the paragraph]
    

    You can also do nested inline elements:

    p: This is a #[a(href="#") link with a nested #[span element]]
    

提交回复
热议问题