Skip to content

docs +update (v1): underscore escaping behaves differently from v2 and documentation #989

@Schopenhauer-loves-Hegel

Description

Description

When using docs +update with the default v1 API, the markdown parser handles underscore (_) escaping differently from v2 and from what the lark-doc-md.md reference documents.

Steps to Reproduce

  1. Create a document with content containing double underscores (e.g., Python dunder methods):
lark-cli docs +update --doc "<doc_id>" --mode overwrite --markdown @content.md

Where content.md contains a table like:

| Operator | Name |
|----------|------|
| aten::__ior__ | dunder_ior |
  1. With escaped underscores (\_\_ior\_\_): The backslashes are rendered literally in the document, showing \_\_ior\_\_ instead of __ior__.

  2. Without escaping (__ior__): The content displays correctly as __ior__.

Expected Behavior

According to the lark-doc-md.md skill reference, _ is listed as an "unconditionally escaped character" that must be escaped with \_ at any position. This rule appears to only apply to the v2 API (--api-version v2 --doc-format markdown), but the documentation does not clearly state this distinction.

Actual Behavior

  • v1 API (default): Escaped underscores \_ are rendered literally (backslashes visible in document). Unescaped underscores work correctly.
  • v2 API: Escaping works as documented.

Suggestion

Please clarify in the documentation that the escaping rules in lark-doc-md.md apply specifically to the v2 API, or unify the behavior between v1 and v2.

Environment

  • lark-cli version: @larksuite/cli@1.0.33
  • OS: Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    domain/coreCLI framework and core librariesdomain/docDocs domain

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions