Skip Menu |

This queue is for tickets about the Org-Parser CPAN distribution.

Report information
The Basics
Id: 100396
Status: resolved
Priority: 0/
Queue: Org-Parser

People
Owner: Nobody in particular
Requestors: lbmoore [...] hethcote.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Parsing headlines that are links
Date: Sun, 16 Nov 2014 21:09:37 -0700 (MST)
To: bug-Org-Parser [...] rt.cpan.org
From: "Louis B. Moore" <lbmoore [...] hethcote.com>
If a headline is only a link, for example * [[file:notes/index.org][Notes]] if ($_->isa("Org::Element::Headline")) { my $headtitle = $_->title(); my $text = $headtitle->text(); my $string = $headtitle->as_string(); ... } $text will be returned as '' and $string as '[[file:notes/index.org][Notes]]' I think that $headtitle->text() should probably return 'Notes' and $headtitle->as_string() should return '[[file:notes/index.org][Notes]]' Louis
On Sun Nov 16 23:09:45 2014, lbmoore@hethcote.com wrote: Show quoted text
> > If a headline is only a link, for example > > * [[file:notes/index.org][Notes]] > > if ($_->isa("Org::Element::Headline")) { > > my $headtitle = $_->title(); > my $text = $headtitle->text(); > my $string = $headtitle->as_string(); > > ... > > } > > $text will be returned as '' and $string as > '[[file:notes/index.org][Notes]]' > > I think that $headtitle->text() should probably return 'Notes' and > $headtitle->as_string() should return '[[file:notes/index.org][Notes]]' > > > Louis >
You can now use the as_text() method for this. $ perl -MOrg::Parser -E'$doc = Org::Parser->new->parse("* [[file:notes/index.org][Notes]]\n"); say $doc->children->[0]->title->as_text' Notes
Subject: Re: [rt.cpan.org #100396] Resolved: Parsing headlines that are links
Date: Wed, 19 Nov 2014 06:19:34 -0700 (MST)
To: Perl Ancar via RT <bug-Org-Parser [...] rt.cpan.org>
From: "Louis B. Moore" <lbmoore [...] hethcote.com>
Thank you, That takes care of my needs perfectly. On Tue, 18 Nov 2014, Perl Ancar via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=100396 > > > According to our records, your request has been resolved. If you have any > further questions or concerns, please respond to this message. > >