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


当前回答

一种方法是使用项目符号,它允许您指定多个缩进级别。项目符号用两个空格、星号和另一个空格的倍数插入。

this is a normal line of text
  * this is the first level of bullet points, made up of <space><space>*<space>
    * this is more indented, composed of <space><space><space><space>*<space>

这种方法有一个很大的优点,那就是当您查看原始文本时,它也很有意义。

如果你不想看到项目符号本身,你应该(取决于你在哪里使用markdown)能够为整个标记下来的区域在css中添加li {list-style-type: none;}。

其他回答

对于引用/缩进的段落,这个hack可能会工作(取决于渲染引擎):

| | | |
|-|-|-|
|  | _"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."_ | |
|

呈现为:

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

嵌套的更深层次: ----在这里留下一个空行 *第一级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.

正如@AlexDupuy在评论中指出的,定义列表可以用于此。

这不是所有的降价处理器都支持,但广泛可用:降价指南-定义列表

Term 1
: definition 1
: definition 2

Term 2
: definition 1
: definition 2

呈现为(html):

<dl>
    <dt>Term 1</dt>
    <dd>definition 1</dd>
    <dd>definition 2</dd>
    <dt>Term 2</dt>
    <dd>definition 1</dd>
    <dd>definition 2</dd>
</dl>

通常,DT以类似标题的格式呈现,而每个DD以缩进文本的形式呈现。

如果你不想要标题/术语,只需使用一个不间断的空格来代替定义术语:

&nbsp;
: This is the text that I want indented.  All text on the same line as the preceding colon will be included in this definition.
: If you include a second definition you'll get a new line; potentially separated by a space. <br />Some inline HTML may be supported within this too, allowing you to create new lines without spaces.
: Support for other markdown syntax varies; e.g. we can add a bullet list, but each one's wrapped in a separate definition term, so the spacing may be out.
: - item 1
: - item 2
: - item 3

你可以复制粘贴上面的例子到这个站点:Stack Edit Markdown Editor

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

Line 1
> line 2 
>> line 3

做制表符,然后是+号,然后空格,然后是内容

So

*一级 +二级标签