Jade:段落中的链接?

内容来源于 Stack Overflow,并遵循CC BY-SA 3.0许可协议进行翻译与使用

  • 回答 (2)
  • 关注 (0)
  • 查看 (18)

试着用Jade写几段文章,但当段落中有链接时:

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.
提问于
用户回答回答于

使用以下语法添加内联元素:

#[a.someClass A Link!]

如果没有进入p中的多行,则如下所示:

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]

还可以执行嵌套的内联元素:

p: This is a #[a(href="#") link with a nested #[span element]]
用户回答回答于

可以使用标记筛选器和使用标记(并允许HTML)来编写段落

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

或者

p
  | this is the start of the para.
  | <a href="http://example.com">a link</a>
  | and this is he rest of the paragraph

尝试过这个:

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

扫码关注云+社区