Skip to content

docs +create: Code blocks get a spurious trailing empty line 飞书文档中的代码块总是跟一个空白行 #53

@OlorinMedas

Description

@OlorinMedas

Summary

When creating a Feishu document from Markdown using lark-cli docs +create, every fenced code block in the resulting document gets an extra trailing empty line that does not exist in the source Markdown.

Steps to Reproduce

  1. Prepare a Markdown file with a fenced code block:

    Some text before.
    
    ```
    line_one
    line_two
    ```
    
    Some text after.
  2. Create a Feishu document:

    lark-cli docs +create --title "test" --content-file test.md
  3. Open the created document in Feishu. The code block renders as:

    line_one
    line_two
    ⬇️ (unwanted blank line here)
    

Expected Behavior

The code block should contain exactly the lines from the source Markdown, with no extra trailing blank line.

Actual Behavior

Every code block has one extra empty line appended at the end. This is cosmetic but noticeable, especially when multiple code blocks are present — each one has the spurious blank line.

Investigation

The Markdown content passed to the API was confirmed correct (no trailing newline in the code block). The extra line appears to be introduced by the Lark OpenAPI document creation endpoint or the CLI's Markdown-to-block conversion layer.

Environment

  • @larksuite/cli version: 1.0.0
  • Platform: Windows 11
  • Node.js: installed via npm global
  • Brand: feishu

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions