<commit_before><?php
namespace selvinortiz\doxter\fields\data;

use Craft;

use function selvinortiz\doxter\doxter;

/**
 * Represents raw (source) and html (output) for the field type value
 *
 * Class DoxterData
 *
 * @package selvinortiz\doxter\fields\data
 */
class DoxterData extends \Twig_Markup {

    protected $raw;
    protected $html;

    public function __construct($raw) {
        $this->raw  = $raw;
        $this->html = doxter()->api->parse($raw);

        parent::__construct($this->html, Craft::$app->charset);
    }

    /**
     * Returns the field type text (markdown source)
     *
     * @return string
     */
    public function getRaw() {
        return ! empty($this->raw) ? $this->raw : '';
    }

    /**
     * Alias of parse()
     *
     * @see parse()
     *
     * @param array $options
     *
     * @return \Twig_Markup
     */
    public function getHtml(array $options = []) {
        return $this->parse($options);
    }

    /**
     * Returns the field type html (parsed output)
     *
     * @param array $options Parsing options if any
     *
     * @return \Twig_Markup
     */
    public function parse(array $options = []) {
        if (! empty($options)) {
            $this->html = doxter()->api->parse($this->raw, $options);
        }

        return $this->html;
    }
}<commit_msg>Fixed default rendering output to be parsed html<commit_after><?php
namespace selvinortiz\doxter\fields\data;

use Craft;

use function selvinortiz\doxter\doxter;

/**
 * Represents raw (source) and html (output) for the field type value
 *
 * Class DoxterData
 *
 * @package selvinortiz\doxter\fields\data
 */
class DoxterData extends \Twig_Markup {

    protected $raw;
    protected $html;

    public function __construct($raw) {
        $this->raw  = $raw;
        $this->html = doxter()->api->parse($raw);

        parent::__construct($this->html, Craft::$app->charset);
    }

    public function __toString() {
        return (string) $this->html;
    }

    /**
     * Returns the field type text (markdown source)
     *
     * @return string
     */
    public function getRaw() {
        return ! empty($this->raw) ? $this->raw : '';
    }

    /**
     * Alias of parse()
     *
     * @see parse()
     *
     * @param array $options
     *
     * @return \Twig_Markup
     */
    public function getHtml(array $options = []) {
        return $this->parse($options);
    }

    /**
     * Returns the field type html (parsed output)
     *
     * @param array $options Parsing options if any
     *
     * @return \Twig_Markup
     */
    protected function parse(array $options = []) {
        if (! empty($options)) {
            $this->html = doxter()->api->parse($this->raw, $options);
        }

        return $this->html;
    }
}
{'fraction_non_alphanumeric': 0.14444843693855552, 'fraction_numerical': 0.0, 'mean_word_length': 2.207373271889401, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 32, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3197703', 'n_tokens_mistral': 887, 'n_tokens_neox': 872, 'n_words': 209}