Skip to content

Add reusable Markdown section updates - #53

Merged
dblock merged 1 commit into
masterfrom
dblock/markdown-sections
Nov 11, 2026
Merged

dblock merged 1 commit into
masterfrom
dblock/markdown-sections

Conversation

@dblock

@dblock dblock commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Add RubyGemRelease::Markdown::Section with exact-heading validation, full-body replace!, and scoped gsub!(pattern, replacement) for changing matching body text.
  • gsub! accepts strings and regular expressions with capture references, preserves other body text and surrounding sections, normalizes inserted line endings, and does not write when nothing matches. Heading boundaries remain intact even when substitutions match boundary whitespace or insert into an empty section.
  • Share Commonmarker source parsing with changelogs; reject missing/duplicate headings and ignore quoted, code, and HTML examples when locating headings.
  • Replace the lifecycle example README regular expression with the helper and document both editing methods.

Validation

  • bundle exec rake: 342 examples, no failures; RuboCop clean.
  • bundle exec rake build.
  • Built-archive API check verifies heading boundaries, scoped substitution, capture references, CRLF preservation, and an absent final newline without RSpec.

Created by an AI on behalf of @dblock.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dblock
dblock force-pushed the dblock/markdown-sections branch from c794f2e to 521aa41 Compare November 11, 2026 17:55
@dblock
dblock merged commit fe7fedb into master Nov 11, 2026
8 checks passed
@dblock
dblock deleted the dblock/markdown-sections branch November 11, 2026 18:26
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