-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement a generic links & text extractor
Before this, links would only be scraped from paragraphs and rendered as a block after parent paragraph. This replaces this logic with a generic links extractor that would recursively collect every link from any parent node, including footnotes, blockquotes, and lists. The renderer splits links block in three separate blocks, one containing footnotes, the second containing images, and the third links. Blocks are separated by a single line break. This also makes the renderer skip link-only lists from rendering, making them behave like links-only paragraphs (which are already rendered as a series of consecutive links). The old behavior of extracting links from links-only paragraphs (where the paragraph itself is treated as just a set of links) remains, and can be still used. The text extraction is also now unified across headings, paragraphs, table headings, blockquotes, and other elements where it was used. This fixes a number of bugs (like panicking on links inside headings) and shortcomings where renderer would render text differently based on container element type. Fixes #17 and #23.
- Loading branch information
Showing
1 changed file
with
157 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters