Skip to content

feat: add blockquote support to from_markdown() and Post.blockquote()#40

Open
ASRagab wants to merge 1 commit intoma2za:mainfrom
ASRagab:feat/blockquote-support
Open

feat: add blockquote support to from_markdown() and Post.blockquote()#40
ASRagab wants to merge 1 commit intoma2za:mainfrom
ASRagab:feat/blockquote-support

Conversation

@ASRagab
Copy link
Contributor

@ASRagab ASRagab commented Mar 24, 2026

Summary

Adds blockquote (>) support to both the from_markdown() parser and as a convenience method on Post.

Changes

  • Post.blockquote(content) — new convenience method following the pattern of heading(), horizontal_rule(), etc. Accepts string or pre-built paragraph content.
  • from_markdown() — parses > prefixed lines into blockquote nodes using flush-based grouping (same pattern as bullet lists). Consecutive blockquote lines become a single blockquote with multiple paragraph children. Blank lines between blockquotes create separate blockquote nodes.
  • Inline formatting preserved — bold, italic, links all work inside blockquotes via parse_inline().

Tests

Added 10 tests (8 from_markdown scenarios + 2 blockquote() method tests):

  • Single-line and multi-line blockquotes
  • Separation by blank lines
  • Blockquote-to-paragraph transitions
  • Inline link preservation inside blockquotes
  • Adjacency to bullet lists
  • Empty continuation lines
  • String input and method chaining

All 16 tests pass (6 existing + 10 new).

Motivation

Blockquotes are one of the most common Markdown elements but were not supported in from_markdown(). This closes that gap while following the existing code patterns.

@ASRagab ASRagab force-pushed the feat/blockquote-support branch from 5a454fc to eddc6b1 Compare March 24, 2026 02:20
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