Last modified: 2006-01-18 02:36:44 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T2684, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 684 - Allow Parser extensions to use tags with parameters
Allow Parser extensions to use tags with parameters
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
unspecified
All All
: Normal enhancement with 2 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
http://www.nohat.net/phase3/index.php...
: patch
: 1726 (view as bug list)
Depends on:
Blocks: 224 1962 4529
  Show dependency treegraph
 
Reported: 2004-10-11 05:41 UTC by David Friedland
Modified: 2006-01-18 02:36 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Patch to allow Parser extensions to use tags with parameters (4.53 KB, patch)
2004-10-11 05:44 UTC, David Friedland
Details
Patch to allow Parser extensions to use tags with parameters (90.62 KB, patch)
2004-10-11 06:21 UTC, David Friedland
Details
Patch to allow Parser extensions to use tags with parameters (4.81 KB, patch)
2004-10-11 06:23 UTC, David Friedland
Details
Patch to allow Parser extensions to use tags with parameters (3.71 KB, patch)
2004-10-11 20:14 UTC, David Friedland
Details
Patch to allow Parser extensions to use tags with parameters (3.69 KB, patch)
2004-10-11 20:33 UTC, David Friedland
Details
Patch to allow Parser extensions to use tags with parameters (4.88 KB, patch)
2004-10-11 21:15 UTC, David Friedland
Details
New version of patch to allow extensions (4.88 KB, patch)
2004-10-11 21:31 UTC, David Friedland
Details
Allow single or double quotes strings (5.06 KB, patch)
2004-10-12 02:36 UTC, David Friedland
Details

Description David Friedland 2004-10-11 05:41:43 UTC
Parser extensions (like <math>) should be able to be invoked with XML-like parameters. For example <math 
param1="val">. Also, for the forthcoming phonetics parser extension, things like <phon encoding="ipa" 
display="ipa,xsampa"> do tell the extension that the given phonetic data is in IPA encoding and should be rendered in IPA 
encoding and X-SAMPA encoding.
Comment 1 David Friedland 2004-10-11 05:44:10 UTC
Created attachment 85 [details]
Patch to allow Parser extensions to use tags with parameters

This is a patch that parses out parameters for tags and passes them to the
appropriate rendering function
Comment 2 David Friedland 2004-10-11 06:21:17 UTC
Created attachment 86 [details]
Patch to allow Parser extensions to use tags with parameters

Fix from previous version of this patch which allows backslash-escaped quote
characters (\") inside of parameter values.
Comment 3 David Friedland 2004-10-11 06:23:55 UTC
Created attachment 87 [details]
Patch to allow Parser extensions to use tags with parameters

Oops. Last attachment was whole Parser.php file. This is just the diff.
Comment 4 David Friedland 2004-10-11 20:14:34 UTC
Created attachment 91 [details]
Patch to allow Parser extensions to use tags with parameters

Uses same regexp for matching attributes in extractTagsAndParams as in
extractParams
Comment 5 David Friedland 2004-10-11 20:22:10 UTC
This patch is installed on my test wiki at
http://www.nohat.net/phase3/index.php/Main_Page
It can be verified to be working correctly there.
Comment 6 David Friedland 2004-10-11 20:33:35 UTC
Created attachment 93 [details]
Patch to allow Parser extensions to use tags with parameters

Change parameter name to match \w+ instead of [A-Za-z0-9_]+
Comment 7 David Friedland 2004-10-11 21:15:23 UTC
Created attachment 94 [details]
Patch to allow Parser extensions to use tags with parameters

-u diff
Comment 8 David Friedland 2004-10-11 21:19:42 UTC
nevermind the most recent patch. it's broken
Comment 9 David Friedland 2004-10-11 21:19:54 UTC
Comment on attachment 94 [details]
Patch to allow Parser extensions to use tags with parameters

this is broken
Comment 10 David Friedland 2004-10-11 21:31:37 UTC
Created attachment 95 [details]
New version of patch to allow extensions 

this fixes a problem with the parameter matching regexp in strip()
Comment 11 David Friedland 2004-10-12 01:33:21 UTC
This is now fully functional and succeeds the parser tests. Ready to be committed
Comment 12 David Friedland 2004-10-12 02:36:24 UTC
Created attachment 96 [details]
Allow single or double quotes strings

Fix per Brion's suggestion to allow parameters of the form param="data" or
param='data' i.e. allow single or double quoted strings
Comment 13 Brion Vibber 2004-10-12 07:37:54 UTC
I'm wondering why the \" and \' thing? XML tags don't work that way and I'm reluctant to introduce a behavior that's likely to cause 
inconsistency headaches.

Also, spaces between the opening < and the tag name should not be allowed; though that bug has existed before we should probably take it out.
Comment 14 Brion Vibber 2005-03-21 06:38:48 UTC
*** Bug 1726 has been marked as a duplicate of this bug. ***
Comment 15 Ævar Arnfjörð Bjarmason 2005-04-09 03:24:40 UTC
Well the alternative would be to allow something like urlencoding, i.e.
param="'%22'" instead of param="'\"'", I think the latter is easier to understand.
Comment 16 Brion Vibber 2005-04-14 05:17:55 UTC
Why would we want to invent a new kind of encoding for XML attributes instead of the standard one? (&quot;)
Comment 17 Ævar Arnfjörð Bjarmason 2005-05-13 15:31:26 UTC
(In reply to comment #12)
> Created an attachment (id=96) [edit]
> Allow single or double quotes strings

This fails on the current REL1_4 and HEAD (revisions 1.357 and 1.434)
Comment 18 Brion Vibber 2005-06-03 08:14:54 UTC
Checked into CVS HEAD with modification: tag matching is done in the style we accept HTML 
elements, and the attribute values are properly decoded to UTF-8 strings for internal use.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links