Home / Function/ _process_links() — langchain Function Reference

_process_links() — langchain Function Reference

Architecture documentation for the _process_links() function in html.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  ff63d8f1_7353_0b16_2f96_7dadb57a8348["_process_links()"]
  5af47ada_f6e1_33df_ed07_12ca64351fa0["HTMLSemanticPreservingSplitter"]
  ff63d8f1_7353_0b16_2f96_7dadb57a8348 -->|defined in| 5af47ada_f6e1_33df_ed07_12ca64351fa0
  127c75d0_d814_d16e_a93c_928f021add9c["split_text()"]
  127c75d0_d814_d16e_a93c_928f021add9c -->|calls| ff63d8f1_7353_0b16_2f96_7dadb57a8348
  4134a695_a3ab_4bed_f7a0_3a766652fc3e["_find_all_tags()"]
  ff63d8f1_7353_0b16_2f96_7dadb57a8348 -->|calls| 4134a695_a3ab_4bed_f7a0_3a766652fc3e
  style ff63d8f1_7353_0b16_2f96_7dadb57a8348 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/text-splitters/langchain_text_splitters/html.py lines 796–808

    def _process_links(soup: BeautifulSoup) -> None:
        """Processes the links in the HTML content.

        Args:
            soup: Parsed HTML content using BeautifulSoup.
        """
        for a_tag in _find_all_tags(soup, name="a"):
            a_href = a_tag.get("href", "")
            a_text = a_tag.get_text(strip=True)
            markdown_link = f"[{a_text}]({a_href})"
            wrapper = soup.new_tag("link-wrapper")
            wrapper.string = markdown_link
            a_tag.replace_with(NavigableString(markdown_link))

Subdomains

Called By

Frequently Asked Questions

What does _process_links() do?
_process_links() is a function in the langchain codebase, defined in libs/text-splitters/langchain_text_splitters/html.py.
Where is _process_links() defined?
_process_links() is defined in libs/text-splitters/langchain_text_splitters/html.py at line 796.
What does _process_links() call?
_process_links() calls 1 function(s): _find_all_tags.
What calls _process_links()?
_process_links() is called by 1 function(s): split_text.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free