Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

empty strings in .contents with single formatting code #4891

Open
p6rt opened this issue Dec 19, 2015 · 4 comments
Open

empty strings in .contents with single formatting code #4891

p6rt opened this issue Dec 19, 2015 · 4 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Dec 19, 2015

Migrated from rt.perl.org#126966 (status was 'open')

Searchable as RT126966$

@p6rt
Copy link
Author

p6rt commented Dec 19, 2015

From @LLFourn

=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?

@p6rt
Copy link
Author

p6rt commented Dec 19, 2015

From @lizmat

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-archive.perl.org/perl6/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

@p6rt
Copy link
Author

p6rt commented Dec 19, 2015

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Dec 21, 2015

From @LLFourn

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.

https://github.com/perl6/Pod-To-HTML/blob/master/lib/Pod/To/HTML.pm#L246

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

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-archive.perl.org/perl6/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

@p6rt p6rt added the POD label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant