Skip to main content

dom_parser_parse_from_string

Function dom_parser_parse_from_string 

Source
pub fn dom_parser_parse_from_string(
    it: &mut Interp,
    _this: Value,
    args: &[Value],
) -> Result<Value, Value>
Expand description

DOMParser.prototype.parseFromString(str, type) (DOM Parsing and Serialization §4.1)。 入力された文字列を指定された MIME タイプ(text/html, text/xml, application/xml, image/svg+xml 等)でパースし、 独立した Document(主文書以外の文書。#document ノード、dom_doc.rs)を返す。XML エラー時は <parsererror> 要素を持つ文書。 【2026-11-20】HTML は仕様どおりの木(parse_html_document。補った head/body・DOCTYPE・コメントを残す)で作る。