Skip to content

Conversation

@mvogttech
Copy link
Contributor

Summary

  • add a Ctrl+Shift+F command that formats the current document with a markdown formatter and status message
  • keep the text buffer in sync with externally formatted content and document the new shortcut
  • cover the formatter with unit tests to ensure headings, lists, and code fences stay stable

Testing

  • npm test

https://chatgpt.com/codex/tasks/task_e_68f0765b9bc483308febcb240d24fd80

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting

Comment on lines +13 to +18
for (let i = 0; i < lines.length; i++) {
const originalLine = lines[i];
const trimmedEnd = originalLine.replace(/\s+$/u, '');
const fenceMatch = trimmedEnd.trimStart().match(/^(?:```+|~~~+)(.*)$/);

if (inCodeFence) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve Markdown hard line break spaces

The formatter unconditionally trims all trailing whitespace from every non‑code line (const trimmedEnd = originalLine.replace(/\s+$/u, '')). In Markdown, two trailing spaces before a newline are the canonical way to force a hard line break. Invoking the new Ctrl+Shift+F shortcut on text that relies on this syntax will remove those spaces and the renderer will collapse the break back into the same paragraph, altering the document’s meaning. The formatter should skip trimming when a line intentionally ends with two spaces.

Useful? React with 👍 / 👎.

@mvogttech mvogttech closed this Oct 17, 2025
@mvogttech mvogttech deleted the codex/add-auto-format-command-for-markdown-cz3fy8 branch October 17, 2025 03:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants