我想写几行文字。除了每行从第6列开始之外,它们应该正常格式化。例如,我不希望代码块格式规则使这一文本块看起来像代码,因为我将使用其他格式,如粗体面等。如何在Markdown中做到这一点?


当前回答

如果你用的是项目符号,试试这个:

<ul>
  <li>Coffee</li>
  <li>Tea
    <ul>
      <li>Black tea</li>
      <li>Green tea</li>
    </ul>
  </li>
  <li>Milk</li>
</ul>

这是我在样式化markdown时使用的方法。

其他回答

一些Markdown实现似乎使用~字符进行缩进。

为了完整起见,更深入的项目列表如下:

嵌套的更深层次: ----在这里留下一个空行 *第一级A项目-前面没有空格的子弹字符 *二级Aa物品- 1格足够 *三级Aaa物品- 5个空格最少 *第二级Ab项目- 4个空格也可能 *第一个B级道具

嵌套的更深层次:

first level A item - no space in front the bullet character second level Aa item - 1 space is enough third level Aaa item - 5 spaces min second level Ab item - 4 spaces possible too first level B item Nested deeper levels: ...Skip a line and indent eight spaces. (as said in the editor-help, just on this page) * first level A item - no space in front the bullet character * second level Aa item - 1 space is enough * third level Aaa item - 5 spaces min * second level Ab item - 4 spaces possible too * first level B item And there could be even more such octets of spaces.

令人惊讶的是,还没有人提出只使用带填充的div的想法,所以你可以这样做:

<div style="padding-left: 30px;">
My text
</div>

看看这个“>”是否有用:

Line 1
> line 2 
>> line 3

另一种选择是使用像StackEdit这样的降价编辑器。它将html(或文本)转换为所见即所得编辑器中的markdown。您可以在编辑器中创建缩进,标题,列表,它将以markdown格式显示相应的文本。然后您可以保存、发布、共享或下载该文件。你可以在他们的网站上访问它-不需要下载!