[翻译]  Using tags such as bold or italic in slim?

[CHINESE]  在苗条中使用粗体或斜体等标签?


Let's say I have this code in HTML:

假设我在HTML中使用此代码:

<p>Lorem ipsum, <b>volutpat</b>. Ut wisi enim ad minim veniam.</p>

How would I convert that to slim? Throughout all of Slim's documentation, it never once mentions bold, italic, or any other inline elements. I tried this:

我怎么把它转换成苗条?在整个Slim的所有文档中,它从未提及过粗体,斜体或任何其他内联元素。我试过这个:

p Lorem ipsum, b volutpat. Ut wisi enim ad minim veniam.

As expected it just added a 'b' to the text. I also tried using tubes:

正如预期的那样,它只是在文本中加了一个'b'。我也试过用过试管:

p Lorem ipsum, 
  | b volutpat.
  | Ut wisi enim ad minim veniam.

This gave me the exact same result, plus. If anyone could help, I'd greatly appreciate it! Here is just a few trials that I was trying to work out: http://codepen.io/spikeyty/pen/wruIs

这给了我完全相同的结果,加上。如果有人可以提供帮助,我将非常感激!以下是我试图解决的一些试验:http://codepen.io/spikeyty/pen/wruIs

3 个解决方案

#1


16  

It's sometimes not worth following every rule. Use this and you are fine.

有时候不值得遵循每条规则。使用这个,你很好。

p Lorem ipsum, <b>volutpat</b>. Ut wisi enim ad minim veniam.

You can also use Markdown directly in Slim if a lot of bolds and italics appear in your text, for example:

如果文本中出现大量粗体和斜体,您也可以直接在Slim中使用Markdown,例如:

p Normal slim syntax.
markdown:
  Lorem Markdownum, **volutpat**. Ut wisi *enim* ad minim `veniam`.

#2


16  

p
 |Lorem ipsum, 
 b volutpat. 
 |Ut wisi enim ad minim veniam.

This gets rendered as "Lorem ipsum, volutpat. Ut wisi enim ad minim veniam." (see your updated codepen).

这被呈现为“Lorem ipsum,volutpat.Ut wisi enim ad minim veniam。” (请参阅最新的codepen)。

Source: https://groups.google.com/forum/#!topic/slim-template/h8fYkG5lj9k

来源:https://groups.google.com/forum/#!topic/slim-template/h8fYkG5lj9k

#3


6  

Those tags are considered deprecated, please consider using their newer versions.

这些标签被认为已弃用,请考虑使用他们的新版本。

<b> has been replaced with <strong>

已替换为

<i> has been replaced with <em>

已被取代

It shoud be something like

它应该是类似的东西

p
  | Lorem ipsum,
  strong volutpat.
  | Ut wisi enim ad minim veniam.

codepen

codepen


注意!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系我们删除。



 
© 2014-2018 ITdaan.com 粤ICP备14056181号