FFenceLilt
Product

Product features · Restricted backtick block extraction

01

Use fenced_blocks.py to separate recognized fence markers from ordinary text, keeping the extracted body inert.

01

Connection

Base URL, credentials and a reachable server.

02

Selection

A model available through the configured endpoint.

03

Capabilities

Context limits and tool support are determined by the model and server.

Restricted backtick block extraction

● ● ●FenceLilt●
A concrete starting point · Restricted backtick block extraction ×
import re

def fenced_blocks(text):
    if type(text) is not str or len(text) > 4096:
        raise ValueError("fence.input")
    blocks, body, language = [], None, None
    for line in text.splitlines():
        if body is None:
            opening = re.fullmatch(r"```([A-Za-z0-9_-]*)", line)
            if opening:
                body, language = [], opening[1]
        elif line == "```":
            blocks.append((language, "\n".join(body)))
            body = None
        else:
            body.append(line)
    if body is not None:
        raise ValueError("fence.unclosed")
    return blocks
✳Restricted backtick block extraction
✓ ChangesReview before applying ↗
Illustrative workspace
AI coding workspace

Your next change starts here.

Get the Windows app ↗