Skip to content

Support <!-- no-format --> HTML comment syntax for markdown code blocks - #2642

Draft
calda with Copilot wants to merge 1 commit into
developfrom
copilot/update-markdown-no-format-syntax
Draft

Support <!-- no-format --> HTML comment syntax for markdown code blocks#2642
calda with Copilot wants to merge 1 commit into
developfrom
copilot/update-markdown-no-format-syntax

Conversation

Copilot AI commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Not all markdown renderers support the existing inline no-format syntax (```swift no-format). This adds support for an HTML comment on the line immediately preceding the code block as an alternative:

<!-- no-format -->
```swift
func example()
{
    doSomething()
}
```

Changes

  • Sources/CommandLine.swiftparseCodeBlocks now checks the line before an opening fence for <!-- no-format --> and merges it into the block's options. Combines with any inline options if both are present.
  • README.md — Documents both syntaxes in the "Code block options" section.
  • Tests/ParsingHelpersTests.swift — Three test cases: basic HTML comment syntax, combined with inline options, and a blank line between comment and fence (should not apply).

Co-authored-by: calda <1811727+calda@users.noreply.github.com>
@codecov

codecov Bot commented Aug 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.45%. Comparing base (dac0c06) to head (1e8a047).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #2642   +/-   ##
========================================
  Coverage    95.44%   95.45%           
========================================
  Files          177      177           
  Lines        27073    27084   +11     
========================================
+ Hits         25841    25853   +12     
+ Misses        1232     1231    -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

2 participants