HTML Parser для MetaFor - v2.3.2
    Preparing search index...

    Interface NodeElement

    Узел HTML элемента. Представляет HTML тег с атрибутами и дочерними элементами.

    <div class="container" id="main">
    <h1>Заголовок</h1>
    <p>Текст</p>
    </div>

    Результат:

    {
    "tag": "div",
    "type": "el",
    "string": {
    "class": "container",
    "id": "main"
    },
    "child": [
    {
    "tag": "h1",
    "type": "el",
    "child": [
    {
    "type": "text",
    "value": "Заголовок"
    }
    ]
    },
    {
    "tag": "p",
    "type": "el",
    "child": [
    {
    "type": "text",
    "value": "Текст"
    }
    ]
    }
    ]
    }

    Структура узла:

    • tag - имя HTML тега
    • type - всегда "el" для элементов
    • child - массив дочерних узлов
    • Атрибуты: event, boolean, array, string, style
    interface NodeElement {
        event?: Record<string, ValueEvent>;
        boolean?: Record<string, ValueBoolean>;
        array?: Record<string, ValueArray[]>;
        string?: Record<string, ValueString>;
        style?: Record<string, ValueStyle>;
        tag: string;
        type: "el";
        child?: Node[];
    }

    Hierarchy

    • Attributes
      • NodeElement
    Index

    Properties

    event?: Record<string, ValueEvent>

    События (onclick, onchange, onsubmit и т.д.)

    boolean?: Record<string, ValueBoolean>

    Булевые атрибуты (hidden, disabled, checked, readonly и т.д.)

    array?: Record<string, ValueArray[]>

    Массивы атрибутов (class, rel, ping и т.д.)

    string?: Record<string, ValueString>

    Строковые атрибуты (id, title, alt, href и т.д.)

    style?: Record<string, ValueStyle>

    Стили (CSS в виде строки или объекта)

    tag: string

    Имя HTML тега

    tag: "div"
    
    tag: "button"
    
    type: "el"

    Тип узла - всегда "el" для элементов

    type: "el"
    
    child?: Node[]

    Дочерние узлы элемента (могут быть любого типа Node)

    child: [
    { type: "text", value: "Привет" },
    { type: "text", data: "/context/user/name" }
    ]