Skip to content

Markdown indexing drops text before the first heading, and setext headings #609

Description

@jayhemnani9910

#245 was closed asking for a new issue if this still reproduces on the latest release. Two cases still do, on 0.4.4 (md_to_tree) and on main (run_pageindex.py --md_path):

Acme SDK
========

Acme SDK talks to the Acme API. The default timeout is 30 seconds
and every request is retried 3 times.

## Install

pip install acme

## Usage

Call `acme.run()`.
$ python run_pageindex.py --md_path doc.md --if-add-node-summary no --if-add-node-text yes --if-add-doc-description no
"structure": [
  {"title": "Install", "node_id": "0001", "line_num": 7, "text": "## Install\n\npip install acme"},
  {"title": "Usage", "node_id": "0002", "line_num": 11, "text": "## Usage\n\nCall `acme.run()`."}
]
  1. Text before the first heading is not in any node, so it is not in the tree. A file with no headings produces an empty structure. The PDF paths keep the same kind of content as a Preface node.
  2. Setext headings (Title + === / ---) are not recognized. Here the title is lost along with the intro; in the middle of a file, the section merges into the one before it.

PRs with fixes and tests for both follow.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions