Last modified: 2006-01-18 02:36:44 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.
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
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.
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.
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
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.
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_]+
Created attachment 94 [details] Patch to allow Parser extensions to use tags with parameters -u diff
nevermind the most recent patch. it's broken
Comment on attachment 94 [details] Patch to allow Parser extensions to use tags with parameters this is broken
Created attachment 95 [details] New version of patch to allow extensions this fixes a problem with the parameter matching regexp in strip()
This is now fully functional and succeeds the parser tests. Ready to be committed
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
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.
*** Bug 1726 has been marked as a duplicate of this bug. ***
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.
Why would we want to invent a new kind of encoding for XML attributes instead of the standard one? (")
(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)
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.