package Markup::Text;

use strict; use warnings;

use base 'Object';

use L; # for text_to_html

sub new {
	my ($class, $text) = @_;
	my $self = $class->SUPER::new;
	$self->{text} = $text;
	return $self;
}

sub html {
	my ($self) = @_;
	return text_to_html($self->{text});
}

sub textarea_html {
	my ($self) = @_;
	return text_to_textarea_html($self->{text});
}

sub get {
	my ($self, $text) = @_;
	return $self->{text};
}

sub set {
	my ($self, $text) = @_;
	$self->{text} = $text;
}

sub type {
	return "text";
}

1
