• 首页
  • 归档
  • 友链
  • 微语
  • 书房
  • 相册
  • 关于
  • 登录
  • 搜索
  • 夜间模式
    ©2026  ZSXの小站 Theme by OneBlog
    搜索
    标签
    # Markdown # Telegram # 网站设计 # 网站统计 # 说说部署 # 音乐播放器 # 语法 # 强调语法 # 段落语法 # 标题语法
    技术分享

    Markdown 换行语法

    2025.06.28 / 12 阅读 / 0 评论 / 1186 字
    技术分享

    Markdown 换行语法

    阅读 12 评论 0 发表于2025.06.28
    原文链接: https://markdown.com.cn/basic-syntax/line-breaks.html

    Markdown 换行语法

    在一行的末尾添加两个或多个空格,然后按回车键,即可创建一个换行(<br>)。

    | Markdown语法 | HTML | 预览效果 |
    | :---: | :---: | :---: |
    | This is the first line.
    And this is the second line. | This is the first line.<br>
    And this is the second line. | This is the first line.
    And this is the second line. |

    换行(Line Break)用法的最佳实践

    几乎每个 Markdown 应用程序都支持两个或多个空格进行换行,称为 结尾空格(trailing whitespace) 的方式,但这是有争议的,因为很难在编辑器中直接看到空格,并且很多人在每个句子后面都会有意或无意地添加两个空格。由于这个原因,你可能要使用除结尾空格以外的其它方式来换行。幸运的是,几乎每个 Markdown 应用程序都支持另一种换行方式:HTML 的 <br /> 标签。

    为了兼容性,请在行尾添加“结尾空格”或 HTML 的 <br> 标签来实现换行。

    还有两种其他方式我并不推荐使用。CommonMark 和其它几种轻量级标记语言支持在行尾添加反斜杠 (\) 的方式实现换行,但是并非所有 Markdown 应用程序都支持此种方式,因此从兼容性的角度来看,不推荐使用。并且至少有两种轻量级标记语言支持无须在行尾添加任何内容,只须键入回车键(return)即可实现换行。

    ✅ Do this❌ Don't do this
    First line with two spaces after.
    And the next line.
    First line with a backslash after.\
    And the next line.
    First line with the HTML tag after.<br>
    And the next line.
    First line with nothing after.
    And the next line.
    本文著作权归作者 [ 钟神秀 ] 享有,未经作者书面授权,禁止转载,封面图片来源于 [ 互联网 ] ,本文仅供个人学习、研究和欣赏使用。如有异议,请联系博主及时处理。
    Markdown换行语法
    取消回复

    发表留言
    回复

    首页归档友链微语书房相册关于登录
    Copyright©2026  All Rights Reserved.  Load:0.009 s


    Theme by OneBlog V3.6.5
    夜间模式

    开源不易,请尊重作者版权,保留基本的版权信息。