-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: add standalone HTML support #147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
marcellmanfrin
wants to merge
29
commits into
firecrawl:main
Choose a base branch
from
marcellmanfrin:feature/html-support-pr
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
8b83460
feat: add standalone HTML support
github-actions[bot] b20d2d9
fix: address HTML charset review feedback
marcellmanfrin 8dfa216
fix: harden HTML content detection
marcellmanfrin 341be1b
test: cover HTML detection review regressions
marcellmanfrin 50b9629
fix: address HTML review regressions
marcellmanfrin 9920d30
fix: address second HTML review regressions
marcellmanfrin df61b31
fix: match HTML5 preflight depth semantics
marcellmanfrin 076e77d
fix: address final HTML review findings
marcellmanfrin fbe5339
test: consolidate HTML review regressions
marcellmanfrin c21198b
test: add HTML corpus integration regressions
marcellmanfrin 0c4c81c
test: add controlled HTML corpus fixtures
marcellmanfrin adaf984
test: add LibreOffice HTML corpus regressions
marcellmanfrin 529aaa2
test: add LibreOffice HTML corpus fixtures
marcellmanfrin 2bca8ee
test: cover structural children in nested list wrappers
marcellmanfrin ff5820f
fix: preserve structural children in HTML lists
marcellmanfrin 6372cf0
style: format HTML corpus changes
marcellmanfrin bbff29a
test: refine LibreOffice numbering invariants
marcellmanfrin fe53a0a
test: include HTML fixtures in corpus detection
marcellmanfrin b6c0889
test: add HTML corpus snapshots
marcellmanfrin 5bd85ba
test: keep corpus walk helper local
marcellmanfrin 6c78e2c
style: format corpus walk helper
marcellmanfrin ab653fb
test: isolate HTML corpus fixture helper
marcellmanfrin 6c70669
test: cover non-rendering children inside lists
marcellmanfrin 75cc2d2
fix: ignore non-rendering children when grouping lists
marcellmanfrin c6b7bb1
fix: preserve structural depth across anchor recovery
marcellmanfrin ee58d6a
fix: handle framesets and relative HTML images
marcellmanfrin ce79482
test: update HTML image snapshots
marcellmanfrin b7a119b
fix: close implied paragraphs and preserve bare-hash links in HTML
41a30a5
fix: complete the paragraph-closing start tag set in the HTML preflight
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| import test from 'node:test' | ||
| import assert from 'node:assert/strict' | ||
| import { formatFromBytes, formatFromExtension, toMarkdownBytes } from './index.js' | ||
|
|
||
| test('standalone HTML is exposed through the Node binding', async () => { | ||
| const input = Buffer.from('<!doctype html><h1>Hello</h1><p><b>world</b></p>') | ||
| assert.equal(formatFromExtension('html'), 'html') | ||
| assert.equal(formatFromBytes(input), 'html') | ||
| assert.equal(await toMarkdownBytes(input), '# Hello\n\n**world**\n') | ||
| }) |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| import unittest | ||
|
|
||
| import anydoc | ||
|
|
||
|
|
||
| class HtmlBindingTests(unittest.TestCase): | ||
| def test_standalone_html_is_exposed(self): | ||
| data = b'<!doctype html><h1>Hello</h1><p><b>world</b></p>' | ||
| self.assertEqual(anydoc.format_from_extension('html'), 'html') | ||
| self.assertEqual(anydoc.format_from_bytes(data), 'html') | ||
| self.assertEqual(anydoc.to_markdown_bytes(data), '# Hello\n\n**world**\n') | ||
|
|
||
|
|
||
| if __name__ == '__main__': | ||
| unittest.main() |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.