mirror of
https://github.com/Unstructured-IO/unstructured.git
synced 2025-07-03 23:20:35 +00:00

Currently we [filter img
tags](2addb19473/unstructured/partition/html/partition.py (L226-L229)
)
before tags are converted to Elements by the html partitioner. More
importantly we also don’t currently have a defined “block” / mapping to
support these. This adds these mappings and logic to process.
It also respects `extract_image_block_types` and
`extract_image_block_to_payload` (as we do with pdfs) to determine
whether base64 is included in the metadata.
The partitioned Image Elements sets the text to the img tag’s alt text
if available.
The partitioned Image Elements include the [url in the
metadata](https://github.com/Unstructured-IO/unstructured/blob/main/unstructured/documents/elements.py#L209)
(rather than image_base64) if the img tag src is a url.
## Testing
unit tests have been added for explicit coverage.
existing integration tests and other unit test fixtures have been
updated to account for `Image` elements now present
---------
Co-authored-by: ryannikolaidis <ryannikolaidis@users.noreply.github.com>
148 lines
5.8 KiB
HTML
148 lines
5.8 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8"/>
|
|
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
|
|
<title>
|
|
</title>
|
|
</head>
|
|
<body>
|
|
<p class="UncategorizedText" id="1672cd06afcef46532e0c1ac6d1ef3e4">
|
|
testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3
|
|
</p>
|
|
<p class="UncategorizedText" id="ef1707e2cadf95400b688c2ea15f6657">
|
|
testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3
|
|
</p>
|
|
<p class="UncategorizedText" id="23332b5a74f166672eda00916897d09c">
|
|
testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3
|
|
</p>
|
|
<p class="UncategorizedText" id="00290c97c096654a5ad758c1aa963b8b">
|
|
testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3
|
|
</p>
|
|
<p class="UncategorizedText" id="252751d6be961b05b423171e53612340">
|
|
testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3
|
|
</p>
|
|
<p class="UncategorizedText" id="9d9ce8fac05e0a6064fc173f51f886b5">
|
|
testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3
|
|
</p>
|
|
<p class="UncategorizedText" id="bcce1169cfd0d24990e5dcf9a1f4417c">
|
|
testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3
|
|
</p>
|
|
<p class="UncategorizedText" id="bef3930174a53244d9333aba98d6ef37">
|
|
testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3
|
|
</p>
|
|
<p class="UncategorizedText" id="40aa9fc4d7bc2522da02123e07615fd1">
|
|
testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3
|
|
</p>
|
|
<p class="UncategorizedText" id="f284f9398e8b26287f59b01df3f87395">
|
|
testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3
|
|
</p>
|
|
<p class="UncategorizedText" id="6da438b97512b144f96de65bcb35c380">
|
|
testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3
|
|
</p>
|
|
<p class="UncategorizedText" id="a3d7fbfb7e7cb92f6c2c809be1aa6a67">
|
|
testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3
|
|
</p>
|
|
<p class="UncategorizedText" id="6780aadfc4e2332b6da7302971e7744e">
|
|
testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3
|
|
</p>
|
|
<p class="UncategorizedText" id="ca6e8673360d0f9a946786edc086f26e">
|
|
testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3 testtext3
|
|
</p>
|
|
<img alt="" class="Image" id="f8085d2948c73dfb968f7b221f3e8fab"/>
|
|
<p class="UncategorizedText" id="48d494bb12fd182b0106bff99dd2e3be">
|
|
Testdoc3 List Item 1
|
|
</p>
|
|
<p class="UncategorizedText" id="3f1b3ecb6515a47b94579cf7de892f09">
|
|
Testdoc3 List Item 1 Nested Item A
|
|
</p>
|
|
<p class="UncategorizedText" id="171423f703a966d2616837ed489f6975">
|
|
Testdoc3 List Item 1 Nested Item B
|
|
</p>
|
|
<p class="UncategorizedText" id="87daeeb71306ae76a90c0e6ccac0dd47">
|
|
Testdoc3 List Item 2
|
|
</p>
|
|
<p class="UncategorizedText" id="c4d15cc61c5d6a3f2350f758b82e487f">
|
|
Testdoc3 List Item 3
|
|
</p>
|
|
<p class="UncategorizedText" id="e069a6333ef83f6f250880a500439da3">
|
|
Testdoc3 List Item 4
|
|
</p>
|
|
<p class="UncategorizedText" id="2f030590e85c72dd4a2fc739cc05affe">
|
|
Testdoc3 List Item 5
|
|
</p>
|
|
<p class="NarrativeText" id="2db738cf60bf0471df90b6141fc6a8e5">
|
|
This is the link for unstructured . io.
|
|
</p>
|
|
<li class="ListItem" id="ab3005ca05b4f48396361646916154b4">
|
|
Testdoc3 Checklist Item 1
|
|
</li>
|
|
<li class="ListItem" id="ac70c0a823f0a1d56777036e77e77fd9">
|
|
Testdoc3 Checklist Item 2 (checked)
|
|
</li>
|
|
<li class="ListItem" id="099fca1cec6f3eaa5f71ed9c2ed235e4">
|
|
Testdoc3 Checklist Item 3
|
|
</li>
|
|
<p class="UncategorizedText" id="85d4a299ad3ee61201530bf0030808b1">
|
|
😃 😃 😃 😃 😃 😃 😃 😃 😃 😃 😃 😃
|
|
</p>
|
|
<p class="NarrativeText" id="a1a4f27d3b3cc32777e25b3bb0766083">
|
|
Testdoc3 bold text
|
|
</p>
|
|
<p class="UncategorizedText" id="976749a5d532d1f18195d61fe8c04be3">
|
|
Testdoc3 italic text
|
|
</p>
|
|
<h1 class="Title" id="079d83c4a7622c70baab0336e3128ec4">
|
|
Testdoc3 Heading 1 Sized Text
|
|
</h1>
|
|
<h1 class="Title" id="68e58e6fec19f4ec291fd5bcca3dadd8">
|
|
Testdoc3 Heading 2 Sized Text
|
|
</h1>
|
|
<h1 class="Title" id="8dbaefc9dcf7af80f14871cdd2b0c1d6">
|
|
Testdoc3 Heading 3 Sized Text
|
|
</h1>
|
|
<h1 class="Title" id="2ca9400f81b794c7d595f9bcd719b18a">
|
|
Testdoc3 Heading 4 Sized Text
|
|
</h1>
|
|
<h1 class="Title" id="191672694e36e804e20214e8c9bd2d44">
|
|
Testdoc3 Heading 5 Sized Text
|
|
</h1>
|
|
<table class="Table" id="10d98c7ebc4b2cd6e5508aa9563cc788" style="border: 1px solid black; border-collapse: collapse;">
|
|
<tr style="border: 1px solid black;">
|
|
<td style="border: 1px solid black;">
|
|
Testdoc3 Table: Column 1 Row 0
|
|
</td>
|
|
<td style="border: 1px solid black;">
|
|
Testdoc3 Table: Column 2 Row 0
|
|
</td>
|
|
<td style="border: 1px solid black;">
|
|
Testdoc3 Table: Column 3 Row 0
|
|
</td>
|
|
</tr>
|
|
<tr style="border: 1px solid black;">
|
|
<td style="border: 1px solid black;">
|
|
Testdoc3 Table: Column 1 Row 1
|
|
</td>
|
|
<td style="border: 1px solid black;">
|
|
Testdoc3 Table: Column 2 Row 1
|
|
</td>
|
|
<td style="border: 1px solid black;">
|
|
Testdoc3 Table: Column 3 Row 1
|
|
</td>
|
|
</tr>
|
|
<tr style="border: 1px solid black;">
|
|
<td style="border: 1px solid black;">
|
|
Testdoc3 Table: Column 1 Row 2
|
|
</td>
|
|
<td style="border: 1px solid black;">
|
|
Testdoc3 Table: Column 2 Row 2
|
|
</td>
|
|
<td style="border: 1px solid black;">
|
|
Testdoc3 Table: Column 3 Row 2
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<img alt="" class="Image" id="45b142b9287e8ebadbc1dfb48ee5245a"/>
|
|
</body>
|
|
</html>
|