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

<nav> element placed after </body> element. #91

Open
mrmaloof opened this issue Mar 24, 2015 · 4 comments
Open

<nav> element placed after </body> element. #91

mrmaloof opened this issue Mar 24, 2015 · 4 comments

Comments

@mrmaloof
Copy link
Contributor

My template contains the <nav> element as used in the navbar example from bootstrap 3. After calling process the <nav> element is placed after the closing </body> tag.

Here is code to illustrate the problem.

#!/usr/bin/perl
use Template::FLute;

my $spec = q{<specification></specification>};

my $html = q{
<nav class="navbar navbar-default">
    <div class="container-fluid">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#">Brand HEY!</a>
        </div>

        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav">
                <li class="active"><a href="#">Link <span class="sr-only">(current)</span></a></li>
            </ul>
        </div>
    </div>
</nav>};

my $flute = Template::Flute->new( specification => $spec, template => $html );
my $out = $flute->process;
print qq{Error\n} unless $out =~ /<body><nav/;
exit;
@racke
Copy link
Owner

racke commented Mar 24, 2015

Please add template HTML which reproduces the problem.

@melmothx
Copy link
Contributor

This is related to this HTML::TreeBuilder bug https://rt.cpan.org/Public/Bug/Display.html?id=103204

As a workaround, wrap the <nav> into a <div> and you'll be fine

@melmothx melmothx mentioned this issue Mar 30, 2015
@racke
Copy link
Owner

racke commented Apr 28, 2015

Which HTML specification defines <nav>?

@mrmaloof
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants