private function parseForeignContents(string $tag, string $html): string
    {
        $remainingHtml = \ltrim($html);

        // Find all contents.
        $remainingHtml = $this->determineRemainingHtmlOfForeignContents(
            $tag,
            $html,
            $remainingHtml
        );

        // Handle no contents.
        if ($this->value === '') {
            return $remainingHtml;
        }

        if ($tag === 'script') {
            $text = new TextJs($this, $this->value);
        } elseif ($tag === 'style') {
            $text = new TextCss($this, $this->value);
        } else {
            $text = new Text($this, $this->value);
        }

        $this->children[] = $text;

        return $remainingHtml;
    }