Jade: Links inside a paragraph

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

    This is the best I can come up with

    -var a = function(href,text){ return ""+text+"" }
    
    p this is an !{a("http://example.com/","embedded link")} in the paragraph
    

    Renders...

    this is an embedded link in the paragraph

    Works ok, but feels like a bit of a hack - there really should be a syntax for this!

提交回复
热议问题