Page 1 of 1

serendipity_plugin_twitter and incorrect xhtml

Posted: Thu Jun 03, 2010 2:35 pm
by juergen
Hi,

using serendipity_plugin_twitter v1.18 there are at least two problems with (x)html validation.

First one is an incomplete image construct in serendipity_plugin_twitter.php line 250. The fuckin alt-tag is missing and the img element is not closed. This is a solvable problem even for me.

The other one appears using the php styled kind of output. The w3c validator prints a dozen of errors for each entry containing a link, I think, but can't evaluate exactly. Using the javascript styled kind of output there is only one error because the </ul> is closing an empty list.

Do you have any suggestions?

Thanks, regards, Juergen

http://arabesken.juergen-luebeck.de/

http://validator.w3.org/check?verbose=1 ... uebeck.de/

Re: serendipity_plugin_twitter and incorrect xhtml

Posted: Fri Jun 04, 2010 8:17 am
by yellowled
juergen wrote:Using the javascript styled kind of output there is only one error because the </ul> is closing an empty list.
Not really an issue since that empty <ul> is filled using Javascript which the validator (depending on its settings?) doesn't consider. So technically, the <ul> is empty when the validator checks it, but is filled with valid code later.
juergen wrote:Do you have any suggestions?
You're right about the img-Tag - plus, there's an align="right" in the code which is deprecated. That's simply sloppy coding, period. I just now committed a fix for that.

I think the validator's output refers to a missing space after the href attribute of links within tweets. (<a href="..."class="..."). Seems to be line 279 in serendipity_plugin_twitter.php, but that's way too much for my PHP knowledge. Maybe Garvin can get this one?

YL

Re: serendipity_plugin_twitter and incorrect xhtml

Posted: Fri Jun 04, 2010 5:43 pm
by juergen
yellowled wrote:I think the validator's output refers to a missing space after the href attribute of links within tweets. (<a href="..."class="..."). Seems to be line 279 in serendipity_plugin_twitter.php, but that's way too much for my PHP knowledge. Maybe Garvin can get this one?
Hi, yes it looks line an "attributes construct error". But my PHP knowledge depends to a level lower than the the basement. That's why I can't see the way the class-phrase is build.
<a href="http://is.gd/cyh9n"class="twitter_update_link">link</a>

Garvin, please take over...

Regards, Juergen

Re: serendipity_plugin_twitter and incorrect xhtml

Posted: Mon Jun 07, 2010 9:26 am
by garvinhicking
Hi!

I think this problem can be fixed in classes/Twitter.php at line 409 :

change

Code: Select all

'<a href="$1"' .$class .'>'
to

Code: Select all

'<a href="$1" ' .$class .'>'
lin line 409. I'll also commit a fix for this.

Regards,
Garvin

Re: serendipity_plugin_twitter and incorrect xhtml

Posted: Mon Jun 07, 2010 9:49 pm
by juergen
Hi and thanks a lot, Garvin.

We have now two changes:

serendipity_plugin_twitter.php at line line 250
classes/Twitter.php at line 409

Unfortunately the changes doesn't matter, w3c validator fails with same messages, "attributes construct error", "Couldn't find end of Start Tag" and so on in the very first line of plugin's output, pointed to the letter "T" from the word Timeline.

Code: Select all

<h3 class="serendipitySideBarTitle serendipity_plugin_twitter">Twitter Timeline</h3>
Another approach. What the hell is the class serendipity_plugin_twitter? Where should these definitions come from? I can't find anything named like this in the generated CSS. Only the lines 764 following from serendipity_event_twitter.php are added to the CSS.

Regards,
Juergen

Re: serendipity_plugin_twitter and incorrect xhtml

Posted: Tue Jun 08, 2010 10:10 am
by garvinhicking
Hi!

.serendipity_plugin_twitter can be used for yourself, it is generic and might not be used by your template.

However I don't understand the error! It gets repeated on and on...I don't see a problem with the line that the validator complains about...

Regards,
Garvin

Re: serendipity_plugin_twitter and incorrect xhtml

Posted: Tue Jun 08, 2010 2:24 pm
by yellowled
garvinhicking wrote:.serendipity_plugin_twitter can be used for yourself, it is generic and might not be used by your template.
I guess this just refers to the class in the sidebar h3, which is added via sidebar.tpl and {$item.class}. However, I don't think this is the source of error. There is someā„¢ mistake with an attribute somewhere in the sidebar. It doesn't seem to be the blog content since the validator gives the same error message for the following archive pages, also for a single entry.

juergen, could you try to disable each sidebar plugin seperately and validate the page after disabling it? That might help to narrow down the source of error. It's probably a good idea to start by setting the twitter sidebar plugin to invisible, but I'm not entirely sure it actually is the source of error ...

YL