ProcessLogin.module - small html error
I posted this already on the ProcessWire forums (http://processwire.com/talk/topic/5699-processloginmodule-small-error/), but kongondo told me it might be a good idea to get an account and post it here:
Cleaning up my code I came across what appears to be a tiny error in /wire/modules/Process/ProcessLogin.module. Validation of the PW login page of a PW 2.4 stable install on http://validator.w3.org/check produces:
Line 77,
Column 99:
No p element in scope but a p end tag seen.
…ef='/processwire_2.4stable_pure/'><i class='fa fa-home'></i> Home</a></div></p>
Changing line 157 in ProcessLogin.module from:
if($links) $out .= "<p>$links</p>";
to:
if($links) $out .= "<p>$links";
fixes this issue for the login page (and I believe that is the only place this module is used).
I see that error in the W3 validator as well, yet if I go look at the markup in my browser's "view source" everything appears to be ok, with both an opening and closing <p> tag in the right place. When W3 validator echos the markup back, it is echoing different markup than what's actually there in view source. Is it possible that it just doesn't like the <div> tags in the markup? I realize that's not allowed in XHTML but thought it was fine in HTML5. However, they could just as easily be made display:block; spans, or add a little code and figure out when to display a <br>. But here's the code that I'm seeing in view source (indenting added here):
<p>
<div>
<a href='./?forgot=1'>
<i class='fa fa-question-circle'></i>
Forgot your password?
</a>
</div>
<div>
<a href='/'>
<i class='fa fa-home'></i>
Home
</a>
</div>
</p>
Hi Ryan,
you're right. I just looked at the login page's source and I do not see the error either, but still get it when validating the same page. So almost certainly a validator quirk. Sorry, I just assumed since the validator found an error it would be one.
Apart from that, even if you had a stray
somewhere it would likely never cause any problems as far as I know.I'm always amazed how on top of working on PW you are able to keep up with the forums, fix bugs etc.! Great work!
Greetings, Joe
On Sat, Mar 8, 2014, at 12:12 PM, Ryan Cramer wrote:
I see that error in the W3 validator as well, yet if I go look at the markup in my browser's "view source" everything appears to be ok, with both an opening and closing
tag in the right place. When W3 validator echos the markup back, it is echoing different markup than what's actually there in view source. Is it possible that it just doesn't like the
tags in the markup? I realize that's not allowed in XHTML but thought it was fine in HTML5. However, they could just as easily be made display:block; spans, or add a little code and figure out when to display a . But here's the code that I'm seeing in view source (indenting added here):
— Reply to this email directly or [1]view it on GitHub. [6831048__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcwOTg5Nj M3MiwiZGF0YSI6eyJpZCI6MjY3Njc5NzB9fQ==--94bf36ab3c87ef4997c9e75e65d5 54741597da68.gif]
References
1. https://github.com/ryancramerdesign/ProcessWire/issues/383#issuecomment-37095145
http://www.fastmail.fm - Choose from over 50 domains or use your own
@J-o-e Is this still an issue?