Escape

version: 9 7 560 official


描述

功能描述

中文描述

Markdown 智能转义渲染器

此功能用于智能处理文本中的转义字符,并将处理后的内容渲染为 Markdown 格式。

主要特性:

  • 自动识别:自动检测输入文本是否包含转义序列(如 \n, \t, \\ 等)或实际控制字符(如真正的换行符、制表符)
  • 智能转换:根据检测结果自动决定是进行转义还是去转义操作
  • 完整支持:支持所有常见转义字符,包括 \n(换行)、\r(回车)、\t(制表符)、\b(退格)、\f(换页)、\v(垂直制表符)、\\(反斜杠)、\'(单引号)、\"(双引号)、\0(空字符)
  • Markdown 渲染:处理完成后自动使用 marked.js 库渲染为 HTML

使用场景:

  1. 当您的文本包含 \n 等字面转义序列字符串时,系统会将其转换为实际的换行符后再渲染
  2. 当您的文本包含实际的换行符等控制字符时,系统会将其转换为转义序列以便正确显示
  3. 非常适合处理从 API 返回的 JSON 字符串或需要格式化显示的文本内容

English Description

Markdown Smart Escape Renderer

This function intelligently processes escape characters in text and renders the processed content as Markdown format.

Key Features:

  • Auto Detection: Automatically detects whether the input text contains escape sequences (such as \n, \t, \\, etc.) or actual control characters (such as real line breaks, tabs)
  • Smart Conversion: Automatically determines whether to escape or unescape based on detection results
  • Full Support: Supports all common escape characters, including \n (newline), \r (carriage return), \t (tab), \b (backspace), \f (form feed), \v (vertical tab), \\ (backslash), \' (single quote), \" (double quote), \0 (null character)
  • Markdown Rendering: Automatically renders to HTML using the marked.js library after processing

Use Cases:

  1. When your text contains literal escape sequence strings like \n, the system converts them to actual newline characters before rendering
  2. When your text contains actual control characters like real line breaks, the system converts them to escape sequences for proper display
  3. Ideal for handling JSON strings returned from APIs or text content that requires formatted display

快速参考 / Quick Reference

| 转义序列 / Escape Sequence | 含义 / Meaning | |---------------------------|----------------| | \n | 换行 / Newline | | \r | 回车 / Carriage Return | | \t | 制表符 / Tab | | \b | 退格 / Backspace | | \f | 换页 / Form Feed | | \v | 垂直制表符 / Vertical Tab | | \\ | 反斜杠 / Backslash | | \' | 单引号 / Single Quote | | \" | 双引号 / Double Quote | | \0 | 空字符 / Null Character |


关于