Skip to content

fix(docreader): preserve line endings in fenced Markdown - #6225

Open
lanqing431 wants to merge 1 commit into
Tencent:mainfrom
lanqing431:codex/weknora-md-fences
Open

lanqing431 wants to merge 1 commit into
Tencent:mainfrom
lanqing431:codex/weknora-md-fences

Conversation

@lanqing431

Copy link
Copy Markdown

Description

Markdown import normalized every line ending before checking for fenced code. A code sample copied from a CRLF file, or a file with bare CR separators, therefore came back with different contents. Identify fences using the logical line and keep the original line endings when copying fenced text. Tables in the surrounding text still format as before.

Type of change

  • Bug fix

Testing

  • On unmodified main, the new end-to-end parser assertions failed for CRLF and CR. Both pass after the fix.
  • python -m unittest discover -s docreader/tests -p "test_markdown*.py" -v completed with 42 passed and one existing skip.
  • git diff --check origin/main...HEAD passed.
  • The full DocReader discovery command was also attempted on Windows. The local environment hit unrelated failures outside the Markdown tests, including missing dependencies and the POSIX-only pass_fds worker launch. A clean main run also hit failures, including a Windows allocation error during gRPC startup. The full Linux suite is left to CI.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant