<?php

namespace Planaday\Platform\WordpressConfig\ShortcodeLinks;

use Planaday\Html\HtmlParserFactory;
use Planaday\Html\Tags\Tag;
use Planaday\Utility\Debug\Log\Logging;

class ShortcodeToTagConverter {
	use Logging;

	public function __construct(
		protected HtmlParserFactory $htmlParserFactory
	) {}

	public function getShortcode(string $shortcode, string $tag, array $attributes):string {
		$html = Tag::getParsableTag($tag, $attributes);
		$this->logInfo( "Started shortcode $shortcode with html: $html");
		return $this->htmlParserFactory->getParser()->parse($html, $shortcode);
	}

}