Home / Function/ _html_escape() — langchain Function Reference

_html_escape() — langchain Function Reference

Architecture documentation for the _html_escape() function in mustache.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  40658de4_5ff4_9ab6_c82f_d132aac5c2af["_html_escape()"]
  88ae0419_8f6b_8b31_dd8f_a3bc6bbcb7b6["mustache.py"]
  40658de4_5ff4_9ab6_c82f_d132aac5c2af -->|defined in| 88ae0419_8f6b_8b31_dd8f_a3bc6bbcb7b6
  0d68eb8b_8003_f5a3_d717_126f0919d1af["render()"]
  0d68eb8b_8003_f5a3_d717_126f0919d1af -->|calls| 40658de4_5ff4_9ab6_c82f_d132aac5c2af
  style 40658de4_5ff4_9ab6_c82f_d132aac5c2af fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/utils/mustache.py lines 330–342

def _html_escape(string: str) -> str:
    """Return the HTML-escaped string with these characters escaped: `" & < >`."""
    html_codes = {
        '"': "&quot;",
        "<": "&lt;",
        ">": "&gt;",
    }

    # & must be handled first
    string = string.replace("&", "&amp;")
    for char, code in html_codes.items():
        string = string.replace(char, code)
    return string

Domain

Subdomains

Called By

Frequently Asked Questions

What does _html_escape() do?
_html_escape() is a function in the langchain codebase, defined in libs/core/langchain_core/utils/mustache.py.
Where is _html_escape() defined?
_html_escape() is defined in libs/core/langchain_core/utils/mustache.py at line 330.
What calls _html_escape()?
_html_escape() is called by 1 function(s): render.

Analyze Your Own Codebase

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

Try Supermodel Free