Skip Menu |
Report information
Id: 126966
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: lloyd.fourn [at] gmail.com
Cc:
AdminCc:

Severity: (no value)
Tag: POD
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Subject: [POD] empty strings in .contents with single formatting code
From: Lloyd Fournier <lloyd.fourn [...] gmail.com>
Date: Sat, 19 Dec 2015 12:38:08 +0000
To: "rakudobug [...] perl.org" <rakudobug [...] perl.org>
Download (untitled) / with headers
text/plain 786b
=pod C<foo>

say $=pod[0].contents[0].contents.perl;

["", Pod::FormattingCode.new(type => "C", meta => [], config => {}, contents => ["foo"]), ""]

It should be a single FormattingCode. This is a non-trivial bug to me because it makes pod introspection more arduous. If you want to check for a single special formatting code you have to make sure there are "" either side of it.

for example, we do this in perl6/doc already:

I think we should fix it to avoid more things depending on this behaviour.

There are a couple of tests that seem to spec the incorrect behaviour:

I am going to try and fix this one unless there are any objections?




To: "Lloyd Fournier (via RT)" <perl6-bugs-followup [...] perl.org>
From: Elizabeth Mattijsen <liz [...] dijkmat.nl>
Subject: Re: [perl #126966] [POD] empty strings in .contents with single formatting code
Date: Sat, 19 Dec 2015 13:50:37 +0100
Download (untitled) / with headers
text/plain 1.1k
Show quoted text
> On 19 Dec 2015, at 13:38, Lloyd Fournier (via RT) <perl6-bugs-followup@perl.org> wrote: > > # New Ticket Created by Lloyd Fournier > # Please include the string: [perl #126966] > # in the subject line of all future correspondence about this issue. > # <URL: https://rt.perl.org/Ticket/Display.html?id=126966 > > > > =pod C<foo> > > say $=pod[0].contents[0].contents.perl; > > ["", Pod::FormattingCode.new(type => "C", meta => [], config => {}, > contents => ["foo"]), ""] > > It should be a single FormattingCode. This is a non-trivial bug to me > because it makes pod introspection more arduous. If you want to check for a > single special formatting code you have to make sure there are "" either > side of it. > > for example, we do this in perl6/doc already: > https://github.com/perl6/doc/blob/master/htmlify.p6#L379 > > I think we should fix it to avoid more things depending on this behaviour. > > There are a couple of tests that seem to spec the incorrect behaviour: > https://github.com/perl6/roast/blob/master/S26-documentation/08-formattingcodes.t#L9 > > I am going to try and fix this one unless there are any objections?
Looking forward to the PR :-) Liz
Date: Mon, 21 Dec 2015 09:07:52 +0000
Subject: Re: [perl #126966] [POD] empty strings in .contents with single formatting code
To: perl6-bugs-followup [...] perl.org
From: Lloyd Fournier <lloyd.fourn [...] gmail.com>
Download (untitled) / with headers
text/plain 1.6k
Looks like Pod::To::HTML also has to deal with this bug/feature. Looking at it maybe the "twine" implementor thought that this was a good optimization as you can pair iterate. If it's a massive speed saver then I guess I reconsider this.


On Sat, Dec 19, 2015 at 11:51 PM Elizabeth Mattijsen via RT <perl6-bugs-followup@perl.org> wrote:
Show quoted text

> On 19 Dec 2015, at 13:38, Lloyd Fournier (via RT) <perl6-bugs-followup@perl.org> wrote:
>
> # New Ticket Created by  Lloyd Fournier
> # Please include the string:  [perl #126966]
> # in the subject line of all future correspondence about this issue.
> # <URL: https://rt.perl.org/Ticket/Display.html?id=126966 >
>
>
> =pod C<foo>
>
> say $=pod[0].contents[0].contents.perl;
>
> ["", Pod::FormattingCode.new(type => "C", meta => [], config => {},
> contents => ["foo"]), ""]
>
> It should be a single FormattingCode. This is a non-trivial bug to me
> because it makes pod introspection more arduous. If you want to check for a
> single special formatting code you have to make sure there are "" either
> side of it.
>
> for example, we do this in perl6/doc already:
> https://github.com/perl6/doc/blob/master/htmlify.p6#L379
>
> I think we should fix it to avoid more things depending on this behaviour.
>
> There are a couple of tests that seem to spec the incorrect behaviour:
> https://github.com/perl6/roast/blob/master/S26-documentation/08-formattingcodes.t#L9
>
> I am going to try and fix this one unless there are any objections?

Looking forward to the PR   :-)


Liz



This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org