test_dtd_processing_disabled() — langchain Function Reference
Architecture documentation for the test_dtd_processing_disabled() function in test_html_security.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 78bf3fbd_1a94_85cc_034d_d9f023580a27["test_dtd_processing_disabled()"] c36248a5_01d0_c9ad_b6b4_e15022cac62c["TestHTMLSectionSplitterSecurity"] 78bf3fbd_1a94_85cc_034d_d9f023580a27 -->|defined in| c36248a5_01d0_c9ad_b6b4_e15022cac62c style 78bf3fbd_1a94_85cc_034d_d9f023580a27 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/text-splitters/tests/unit_tests/test_html_security.py lines 84–108
def test_dtd_processing_disabled(self) -> None:
"""Test that DTD processing is disabled."""
# HTML with DTD that attempts to define entities
html_with_dtd = """<!DOCTYPE html [
<!ELEMENT html (body)>
<!ELEMENT body (h1, p)>
<!ELEMENT h1 (#PCDATA)>
<!ELEMENT p (#PCDATA)>
<!ENTITY test "This is a test entity">
]>
<html>
<body>
<h1>Header</h1>
<p>&test;</p>
</body>
</html>"""
splitter = HTMLSectionSplitter(headers_to_split_on=[("h1", "Header 1")])
# Process the HTML - entities should not be resolved
result = splitter.split_text(html_with_dtd)
# The entity should not be expanded
all_content = " ".join([doc.page_content for doc in result])
assert "This is a test entity" not in all_content
Domain
Subdomains
Source
Frequently Asked Questions
What does test_dtd_processing_disabled() do?
test_dtd_processing_disabled() is a function in the langchain codebase, defined in libs/text-splitters/tests/unit_tests/test_html_security.py.
Where is test_dtd_processing_disabled() defined?
test_dtd_processing_disabled() is defined in libs/text-splitters/tests/unit_tests/test_html_security.py at line 84.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free