You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何用JavaScript正则实现食谱内容的正确格式化与换行?

Markdown Formatting Rules

Here are the standard Markdown formatting conventions to apply to content:

  • Headings: Use number signs (#) at the start of the line. The count of # determines the heading hierarchy:

    • # Level 1 Heading (largest)
    • ## Level 2 Heading
    • ### Level 3 Heading (smaller)
  • List Items: Begin each list entry with a dash (-). For nested lists, indent the items:

    • Main list item
      • Sub-list item
  • Emphasized Text: Wrap text with asterisks (*):

    • Italicize text: *this text is italic* → this text is italic
    • Bold text: **this text is bold** → this text is bold
  • Code/Commands: Enclose code snippets with backticks (`):

    • Inline code: `npm install` → npm install
    • Multi-line code blocks: Use three backticks (```) on lines before and after the code:
      def hello():
          print("Hello World")
      
  • Quoted Text: Prefix lines with greater than signs (>):

    • > This is a quoted paragraph.

    This is a quoted paragraph.

  • Links: Format as [Display Text](Target URL) — wrap the visible link text in square brackets, followed by the URL in parentheses.

  • Images: Format as ![Alt Text](Image URL) — start with an exclamation mark, then wrap descriptive alt text in square brackets, followed by the image's URL in parentheses.

内容的提问来源于stack exchange,提问作者Rakitha

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.11 11:12:08