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

link containing pod is misparsed in some cases #4929

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

link containing pod is misparsed in some cases #4929

p6rt opened this issue Dec 25, 2015 · 4 comments
Labels
POD

Comments

@p6rt
Copy link

@p6rt p6rt commented Dec 25, 2015

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

Searchable as RT127029$

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented Dec 25, 2015

From @autarch

Here's an example​:

=begin pod

L<It has pod|#Has C<pod>>

=end pod

dd $=pod[0];

The parser decides that the _first_ ">" ends the link, and that the second ">" is a piece of plain text, which is clearly wrong.

Note that writing this as L<<...>> doesn't fix the problem.

The parser does get this right if there is no explicit link text​:

=begin pod

L<#Has C<pod>>

=end pod

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented Dec 26, 2015

From @LLFourn

IMO it looks like both of them are wrong but for different reasons

=pod L<#Has C<pod>>
becomes
# Pod​::FormattingCode.new(type => "L", meta => [], config => {}, contents
=> ["#Has ", Pod​::FormattingCode.new(type => "C", meta => [], config => {},
contents => ["pod"]), ""])

The L<> formatting code without a '|' should not contain a C<> formatting
code it should just be taken verbatim.

On Sat, Dec 26, 2015 at 9​:12 AM Dave Rolsky <perl6-bugs-followup@​perl.org>
wrote​:

# New Ticket Created by Dave Rolsky
# Please include the string​: [perl #​127029]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=127029 >

Here's an example​:

=begin pod

L<It has pod|#Has C<pod>>

=end pod

dd $=pod[0];

The parser decides that the _first_ ">" ends the link, and that the second
">" is a piece of plain text, which is clearly wrong.

Note that writing this as L<<...>> doesn't fix the problem.

The parser does get this right if there is no explicit link text​:

=begin pod

L<#Has C<pod>>

=end pod

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented Dec 26, 2015

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

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented Dec 26, 2015

From @autarch

On Fri Dec 25 19​:12​:14 2015, lloyd.fourn@​gmail.com wrote​:

IMO it looks like both of them are wrong but for different reasons

=pod L<#Has C<pod>>
becomes
# Pod​::FormattingCode.new(type => "L", meta => [], config => {}, contents
=> ["#Has ", Pod​::FormattingCode.new(type => "C", meta => [], config => {},
contents => ["pod"]), ""])

The L<> formatting code without a '|' should not contain a C<> formatting
code it should just be taken verbatim.

I disagree. When L<> contains no '|' you're saying that this is the text you want shown for the link and the link itself as well. It seems like any text to be displayed should be treated as Pod, not something special.

FWIW, it seems like in Perl 5 this does work more or less like that. The text inside "L<<test C<pod>>>" is treated as Pod, not parsed simply as plain text.

@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
Projects
None yet
1 participant
You can’t perform that action at this time.