INNER CODE UNIT · Python

extract_fenced_lock

IvanMurzak/Unity-MCP · .github/scripts/chain_feed.py:674

def extract_fenced_lock(body):
    """The ```chain-lock fenced JSON block of a PR body, or `None`.

    Deliberately a scan for the fence rather than a regex over the whole body: a train PR body
    is prose written by a human and may contain other fenced blocks.
    """
    if not body:
        return None
    lines = str(body).replace("\r\n", "\n").replace("\r", "\n").split("\n")
    collecting = False
    buffer = []
    for line in lines:
        stripped = line.strip()
        if not collecting:
            if stripped.startswith("```") and stripped[3:].strip() == LOCK_FENCE:
                collecting = True
            continue
        if stripped.startswith("```"):

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…