Skip to content

fix(markdown): recognize tab-separated code fence metadata - #36

Merged
palmoni5 merged 1 commit into
mainfrom
palmoni5/markdown-fence-whitespace-20261111
Nov 11, 2026
Merged

palmoni5 merged 1 commit into
mainfrom
palmoni5/markdown-fence-whitespace-20261111

Conversation

@palmoni5

@palmoni5 palmoni5 commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Split a fenced code block info string at the first space or tab. Previously a tab-separated info string (e.g. ```dart<TAB>line-numbers) produced class="language-dart\tline-numbers"; now it yields class="language-dart" and data-metadata="line-numbers", matching cmark and commonmark.js.
  • Return early from escapePunctuation when the input contains no backslash (~20x faster for that call; no measurable end-to-end change).
  • Tests (test/fenced_code_info_test.dart, util_test.dart) and a CHANGELOG entry.

Validation

dart format, dart analyze --fatal-infos, dart test (2829 passed). Differential vs main over spec inputs, 695 pub-cache READMEs/CHANGELOGs, Hebrew/CRLF samples and 80k fuzz cases: output identical except fence info strings containing a literal tab.

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

PR Health

Publish ✔️
Package Version Status Publish tag (post-merge)
package:markdown ⭐ 7.4.1-wip WIP (no publish necessary)
  • 16 already published.
  • 26 WIP (no publish necessary).

Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation.

This check can be disabled by tagging the PR with skip-publish-check.

Changelog Entry ✔️
Package Changed Files

Changes to files need to be accounted for in their respective changelogs.

This check can be disabled by tagging the PR with skip-changelog-check (for example, for non-user-visible changes when the package version is already at -wip).

Breaking changes ✔️
Package Change Current Version New Version Needed Version Looking good?
markdown Non-Breaking 7.3.1 7.4.1-wip 7.4.1-wip ✔️

This check can be disabled by tagging the PR with skip-breaking-check.

API leaks ✔️

The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.

Package Leaked API symbol Leaking sources

This check can be disabled by tagging the PR with skip-leaking-check.

Unused Dependencies ✔️
Package Status
markdown ✔️ All dependencies utilized correctly.

For details on how to fix these, see dependency_validator.

This check can be disabled by tagging the PR with skip-unused-dependencies-check.

License Headers ✔️
// Copyright (c) 2026, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

Files
no missing headers

All source files should start with a license header.

Unrelated files missing license headers
Files
pkgs/html/test/differential_test.dart
pkgs/html/test/dom_parsing_test.dart
pkgs/html/test/mxss_test.dart
pkgs/html/test/noah_ark_clause_limit_test.dart

This check can be disabled by tagging the PR with skip-license-check.

Coverage ✔️
File Coverage
pkgs/markdown/lib/src/block_syntaxes/fenced_code_block_syntax.dart 💚 99 % ⬆️ 0 %
pkgs/markdown/lib/src/util.dart 💚 100 %

This check for test coverage is informational (issues shown here will not fail the PR).

This check can be disabled by tagging the PR with skip-coverage-check.

@palmoni5
palmoni5 force-pushed the palmoni5/markdown-fence-whitespace-20261111 branch from ba1469d to ac693c9 Compare November 11, 2026 16:34
@palmoni5
palmoni5 force-pushed the palmoni5/markdown-fence-whitespace-20261111 branch from ac693c9 to 94a0b81 Compare November 11, 2026 16:35
@palmoni5
palmoni5 force-pushed the palmoni5/markdown-fence-whitespace-20261111 branch from e6f1a70 to 71c6a82 Compare November 11, 2026 16:38
@palmoni5
palmoni5 merged commit cf4cc05 into main Nov 11, 2026
17 checks passed
@palmoni5
palmoni5 deleted the palmoni5/markdown-fence-whitespace-20261111 branch November 11, 2026 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant