package Org::Element::Text; use 5.010; use locale; use Moo; extends 'Org::Element'; with 'Org::ElementRole'; with 'Org::ElementRole::Inline'; our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY our $DATE = '2023-11-06'; # DATE our $DIST = 'Org-Parser'; # DIST our $VERSION = '0.561'; # VERSION has text => (is => 'rw'); has style => (is => 'rw'); our %mu2style = (''=>'', '*'=>'B', '_'=>'U', '/'=>'I', '+'=>'S', '='=>'C', '~'=>'V'); our %style2mu = reverse(%mu2style); sub as_string { my ($self) = @_; my $muchar = $style2mu{$self->style // ''} // ''; join("", $muchar, $self->text // '', $self->children_as_string, $muchar); } sub as_text { my $self = shift; my $muchar = $style2mu{$self->style // ''} // ''; join("", $muchar, $self->text // '', $self->children_as_text, $muchar); } 1; # ABSTRACT: Represent text __END__ =pod =encoding UTF-8 =head1 NAME Org::Element::Text - Represent text =head1 VERSION This document describes version 0.561 of Org::Element::Text (from Perl distribution Org-Parser), released on 2023-11-06. =head1 DESCRIPTION Derived from L. Org::Element::Text is an object that represents a piece of text. It has C and C