Skip to content

fix: ignore bare markdown hash lines as headings - #364

Merged
EricNGOntos merged 1 commit into
mainfrom
fix/wuchengke/bare-md-hash-empty-title
Sep 1, 2026
Merged

fix: ignore bare markdown hash lines as headings#364
EricNGOntos merged 1 commit into
mainfrom
fix/wuchengke/bare-md-hash-empty-title

Conversation

@EricNGOntos

Copy link
Copy Markdown
Contributor

Summary

  • After stripping markdown # markers, lines with no title text are no longer treated as headings.
  • Titled hash lines still use the existing max(hash_level, code_level) path.
  • Prevents empty section paths like file.pdf/ that collapse into Root with a second text chunk.

Test plan

  • make check (lint + typecheck)
  • Local repro: bare # / ## → level -1; # Title keeps positive level and max path
  • Local e2e: bare # no longer flushes a trailing-slash empty section under Root

Made with Cursor

Lines that are only '#' markers have no title text after stripping and
must not open an empty section path during chunking.

Co-authored-by: Cursor <cursoragent@cursor.com>
@EricNGOntos
EricNGOntos merged commit b22c24a into main Sep 1, 2026
6 checks passed
@EricNGOntos
EricNGOntos deleted the fix/wuchengke/bare-md-hash-empty-title branch September 1, 2026 00:38
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