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

Avoid whitespace at the beginning of an indexed word #2801

Closed
JJ opened this issue May 17, 2019 · 3 comments
Closed

Avoid whitespace at the beginning of an indexed word #2801

JJ opened this issue May 17, 2019 · 3 comments
Assignees
Labels
docs Documentation issue (primary issue type) xt Regarding current or new xt/ tests or the utils/

Comments

@JJ
Copy link
Contributor

JJ commented May 17, 2019

The problem

All these files have whitespace at the beginning:

 BEGIN.html
 BEGIN (Phasers).html
 blocks (control flow).html
 blocks.html
 CATCH.html
 CATCH (Phasers).html
 CHECK.html
 CHECK (Phasers).html
 CLOSE (Asynchronous Phasers).html
 CLOSE.html
 COMPOSE (Phasers).html
 CONTROL.html
 CONTROL (Phasers).html
 DOC (Asynchronous Phasers).html
 DOC.html
 END.html
 END (Phasers).html
 ENTER.html
 ENTER (Phasers).html
 enum.html
 Enums.html
 fail (control flow).html
 fail.html
 FIRST.html
 FIRST (Phasers).html
 for (control flow).html
 for.html
 given (control flow).html
 ..html
 **@.html
 ≅ (infix).html
 inheritance (classes).html
 INIT.html
 INIT (Phasers).html
 is raw (trait).html
 KEEP.html
 KEEP (Phasers).html
 LAST (Asynchronous Phasers).html
 last (control flow).html
 last.html
 LAST.html
 LAST (Phasers).html
 LEAVE.html
 LEAVE (Phasers).html
 loop (control flow).html
 loop.html
 Named captures.html
 Named captures (regex).html
 next (control flow).html
 next.html
 NEXT.html
 NEXT (Phasers).html
 once (control flow).html
 once.html
 orwith (control flow).html
 **@ (parameter).html
 POST.html
 POST (Phasers).html
 pragma (experimental).html
 pragma (fatal).html
 pragma (internals).html
 pragma (invocant).html
 pragma (isms).html
 pragma (lib).html
 pragma (MONKEY-GUTS).html
 pragma (MONKEY).html
 pragma (MONKEY-SEE-NO-EVAL).html
 pragma (MONKEY-TYPING).html
 pragma (newline).html
 pragma (nqp).html
 pragma (parameters).html
 pragma (precompilation).html
 pragma (soft).html
 pragma (strict).html
 pragma (trace).html
 pragma (v6).html
 pragma (v6.x).html
 pragma (variables).html
 pragma (worries).html
 PRE.html
 PRE (Phasers).html
 proceed (control flow).html
 proceed.html
 proto regex.html
 quietly (control flow).html
 quietly.html
 QUIT (Asynchronous Phasers).html
 QUIT.html
 Raku and Perl 6 (FAQ) (Rakudo).html
 redo (control flow).html
 redo.html
 ~ ( regex).html
 << (regex).html
 >> ( regex).html
 . (regex).html
 « ( regex).html
 » ( regex).html
 Regex Interpolation.html
 Regex Interpolation (regex).html
 return-rw (control flow).html
 return-rw.html
 statements (control flow).html
 statements.html
 succeed (control flow).html
 succeed.html
 tilde.html
 tilde (regex).html
 UNDO.html
 UNDO (Phasers).html
 unless (control flow).html
 unless.html
 when (control flow).html
 when.html
 <|w>.html
 will trait (Phasers).html
 with (control flow).html
 without (control flow).html
 <|w> (regex).html
 <!|w> (regex).html

Suggestions

Try to avoid that, it might lead to confusion. Maybe also create an xt for it when done.

@JJ JJ added docs Documentation issue (primary issue type) site labels May 17, 2019
@JJ
Copy link
Contributor Author

JJ commented May 17, 2019

Apparently this is caused by lines such as these:

=head1 X<Blocks|control flow, blocks>

And that is an htmlify.p6 hack #1823. So it might be easier to fix that...

@JJ JJ added the build label May 17, 2019
@JJ
Copy link
Contributor Author

JJ commented May 17, 2019

(Assuming that anything is easier with htmlify.p6, of course)

@antoniogamiz
Copy link
Contributor

antoniogamiz commented Jul 13, 2019

Origin

The problem is generated in Pod::FormattingCode objects of type X, due to the way . and ; separators are handled. Here an example:

use v6;

=begin pod

X<content|meta, meta1>

=end pod

say $=pod[0].contents[0].contents[0].meta[0].join("\n");

Which gives the following output:

meta
 meta1

All generated files with this problems comes from disambiguation, so this is related to #2883. Nonetheless, the error is caused by this function:
https://github.com/perl6/doc/blob/1b4ecc2d9175075c0487ca0cccc0458dff894011/htmlify.p6#L492-L524
More exactly:
https://github.com/perl6/doc/blob/1b4ecc2d9175075c0487ca0cccc0458dff894011/htmlify.p6#L497-L503
Where the meta elements are used without a previous call to trim.

Solution

Add .trim to $name before the Perl6::Documentable object is created.

@antoniogamiz antoniogamiz self-assigned this Jul 14, 2019
@JJ JJ closed this as completed in e9f3a9d Sep 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation issue (primary issue type) xt Regarding current or new xt/ tests or the utils/
Projects
None yet
Development

No branches or pull requests

4 participants
@JJ @rafaelschipiura @antoniogamiz and others