Hi, I would like to add some code to allow changing some options on the gallery. In particular I would like to change the thumb size and perhaps also the number of columns (and perhaps also add a caption
I have traced through the relevant bits of code of the parser to where we extract the attributes, but it looks as though the parser right now doesn't allow for attributes in the "<gallery>" tag.
For example if I wanted something like <gallery thumb=150px;cols=1;header="My gallery heading"> then I don't think this extra stuff is parsed out right now?
Any suggestions on the cleanest way to implement this? Will it be accepted for inclusion...?
Thanks
Ed W
Brion Vibber wrote:
Ed W wrote:
Any suggestions on the cleanest way to implement this? Will it be accepted for inclusion...?
Look at the patch in bugzilla on parameters for parser hooks and clean it up.
Do you mean this bug: http://bugzilla.wikimedia.org/show_bug.cgi?id=684
What's wrong with the code as is? Looks great to me?
Please advise what's wrong and I will fix it up - seems great for my purpose
Thanks
Ed W
Ed W wrote:
Do you mean this bug: http://bugzilla.wikimedia.org/show_bug.cgi?id=684
What's wrong with the code as is? Looks great to me?
Please advise what's wrong and I will fix it up - seems great for my purpose
Please read the comments on the bug.
-- brion vibber (brion @ pobox.com)
Ed W wrote:
Do you mean this bug: http://bugzilla.wikimedia.org/show_bug.cgi?id=684
What's wrong with the code as is? Looks great to me?
Please advise what's wrong and I will fix it up - seems great for my purpose
Thanks
Ed W
I wrote this patch. I stopped working on it after a cold reception--my contributions weren't met with much enthusiasm so I stopped pursuing trying to make them.
Brion wants it changed to not allow ' and " as escapes for ' and " inside quoted strings and to not allow whitespace between the opening < and the name of the tag.
Also, Ævar notes that the patch doesn't work on the current HEAD, as the code the patch applies to has probably changed since the patch was written, so it needs some cleaning up.
Hope that helps. Good luck.
- David Friedland
Brion wants it changed to not allow ' and " as escapes for ' and " inside quoted strings and to not allow whitespace between the opening < and the name of the tag.
Brion,
I read this comment on the bugzilla. Whilst I agree that """ should be supported I am a little unsure what is wrong with supporting the " syntax?
Personally I dont do a lot of web development and my first instinct would have been to reach for " to put quotes within quotes. Surely the goal is to have a syntax which is understandable to the general public?
Lets be clear though. Are we talking about stuff like the following:
<gallery caption="Ed said: "Here is my gallery"">
Which you think should *only* be allowed as:
<gallery caption="Ed said: "Here is my gallery"">
The former doesn't feel "inconsistent" to me? (But I am not a hardcore web worker)
Can we not compromise and offer both syntax? Either way it seems like a small detail which is holding back an otherwise very useful patch that seems quite low risk. Eyeballing the patch it looks fairly selfcontained, although my first thought is that we only need the one tag parsing function, params would simply be null if there weren't any params?
Brion: I don't want to run cvs based code on my website, and neither do I want to maintain two versions of a patch. What do we realistically need to do to get this finished off? Making it patch against head is probably trivial, and whilst I would prefer the escaped quotes above it doesn't seem to be a show stopper either way around?
Hoping that we might get such an easy patch moving and into 1.5 for release?
Thanks and good luck
Ed W
Ed W wrote:
Brion wants it changed to not allow ' and " as escapes for ' and " inside quoted strings and to not allow whitespace between the opening < and the name of the tag.
I read this comment on the bugzilla. Whilst I agree that """ should be supported I am a little unsure what is wrong with supporting the " syntax?
If we're using HTML/XML syntax for extension hooks (and we are), then it must behave consistently with the HTML/XML elements we allow. Why would " be magic in some places and not others?
-- brion vibber (brion @ pobox.com)
If we're using HTML/XML syntax for extension hooks (and we are), then it must behave consistently with the HTML/XML elements we allow. Why would " be magic in some places and not others?
Idiot question, but what other examples of places "doesn't" it work? I can't think I have run up against this issue in normal usage? I would probably run up against it in my gallery example though
Might it not be interesting to support this syntax more widely then?
Either way: if we agree on the quotes thing can we pop the rest of the code in?
Ed W
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Ed W schrieb:
Either way: if we agree on the quotes thing can we pop the rest of the code in?
My way of getting round these "fine, except for..." issues is to add Yet Another Global Variable (tm), like
$wgAllowBackslashQuotes = true
Put this in DefaultSettings.php, so the actual decision (in LocalSettings.php) is the problem of the admin, not the programmer ;-)
Magnus
I wrote this patch. I stopped working on it after a cold reception--my contributions weren't met with much enthusiasm so I stopped pursuing trying to make them.
Well I for one would like to see it happen.
Also, Ævar notes that the patch doesn't work on the current HEAD, as the code the patch applies to has probably changed since the patch was written, so it needs some cleaning up.
Well it's pretty hard to apply a patch that doesn't work;)
Just so everyone knows, Brion made some modifications to the patch to make it exhibit the desired behavior, as well as to use some utility functions from the Sanitizer package, and checked it into HEAD last night.
Bug message from Brion: http://bugzilla.wikimedia.org/show_bug.cgi?id=684#c18
Diff of Parser.php from CVS: http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/includes/Parser.php?r1=1.446&r2=1.447
Thanks Brion!
- David
David Friedland wrote:
Ed W wrote:
Do you mean this bug: http://bugzilla.wikimedia.org/show_bug.cgi?id=684
What's wrong with the code as is? Looks great to me?
Please advise what's wrong and I will fix it up - seems great for my purpose
Thanks
Ed W
I wrote this patch. I stopped working on it after a cold reception--my contributions weren't met with much enthusiasm so I stopped pursuing trying to make them.
Brion wants it changed to not allow ' and " as escapes for ' and " inside quoted strings and to not allow whitespace between the opening < and the name of the tag.
Also, Ævar notes that the patch doesn't work on the current HEAD, as the code the patch applies to has probably changed since the patch was written, so it needs some cleaning up.
Hope that helps. Good luck.
- David Friedland
David Friedland wrote:
Just so everyone knows, Brion made some modifications to the patch to make it exhibit the desired behavior, as well as to use some utility functions from the Sanitizer package, and checked it into HEAD last night.
Bug message from Brion: http://bugzilla.wikimedia.org/show_bug.cgi?id=684#c18
Diff of Parser.php from CVS: http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/includes/Parser.php?r1=1.446&r2=1.447
Thanks Brion!
Excellent! That looks splendid.
Thanks Brion!
OK, everyone, lets code something useful with this now!
Ed W
wikitech-l@lists.wikimedia.org