Dear subscribers,
I want to add a new wiki-tag to my mediawiki. I thought that is quite easy but I a too stupid for that. The wiki Tag shoulb be like this:
I write: >>> text here <<< blabla. The three ">>>" shall word like the tags for emphasize. Where can I add now tags? Which files have to be edited? Can I format the text between the ">>>" Tags?
It would be great if there would be a starting tag <div id="bla"> and an ending Tag </div>
Can anyone give me an URL oder help me via eMail?
Thank you all, Felix Damrau
On Sat, 16 Oct 2004 17:02:16 +0200, Felix Damrau mail@felixdamrau.de wrote:
Dear subscribers,
I want to add a new wiki-tag to my mediawiki. I thought that is quite easy but I a too stupid for that.
Well, I'm afraid there *is* no easy way with the current state of the software. The file you need to "play with" is includes/Parser.php (which is not, technically, a "parser").
The wiki Tag shoulb be like this:
I write: >>> text here <<< blabla. The three ">>>" shall word like the tags for emphasize. Where can I add now tags? Which files have to be edited? Can I format the text between the ">>>" Tags?
It would be great if there would be a starting tag <div id="bla"> and an ending Tag </div>
I was wracking my brains trying to think of an example where there isn't all sorts of special handling code in with the regular expressions which are essentially all the "parser" consists of. And then I came upon this function, apparently never called; create something like this, actually call it from somewhere like internalParse() [be careful with what gets processed before or after it]; do plenty of testing (there's a maintenance/parserTests.php which you can run; make sure you create an AdminSettings.php first); and Bob may very well be your uncle...
function doExponent ( $text ) { $fname = 'Parser::doExponent'; wfProfileIn( $fname); $text = preg_replace('/^^(.*)^^/','<small><sup>\1</sup></small>', $text); wfProfileOut( $fname); return $text; }
Come to think, that's not so hard after all - although I don't guarantee it will really be as simple as that.
Rowan Collins wrote:
On Sat, 16 Oct 2004 17:02:16 +0200, Felix Damrau mail@felixdamrau.de wrote:
Dear subscribers,
I want to add a new wiki-tag to my mediawiki. I thought that is quite easy but I a too stupid for that.
Well, I'm afraid there *is* no easy way with the current state of the software. The file you need to "play with" is includes/Parser.php (which is not, technically, a "parser").
The wiki Tag shoulb be like this:
I write: >>> text here <<< blabla. The three ">>>" shall word like the tags for emphasize. Where can I add now tags? Which files have to be edited? Can I format the text between the ">>>" Tags?
It would be great if there would be a starting tag <div id="bla"> and an ending Tag </div>
I was wracking my brains trying to think of an example where there isn't all sorts of special handling code in with the regular expressions which are essentially all the "parser" consists of. And then I came upon this function, apparently never called; create something like this, actually call it from somewhere like internalParse() [be careful with what gets processed before or after it]; do plenty of testing (there's a maintenance/parserTests.php which you can run; make sure you create an AdminSettings.php first); and Bob may very well be your uncle...
function doExponent ( $text ) { $fname = 'Parser::doExponent'; wfProfileIn( $fname); $text = preg_replace('/^^(.*)^^/','<small><sup>\1</sup></small>', $text); wfProfileOut( $fname); return $text; }
Come to think, that's not so hard after all - although I don't guarantee it will really be as simple as that.
Hello,
The doExponent() function is indeed never called. It's a simple case I added in the code just in case the community decided to use a new ^^foobar^^ syntax. At least the good point is that it provides an useful example to add a new syntax token :o)
cheers,
Come again?
so you want stuff >>>foobar<<< more stuff to be parsed as stuff <em>foobar</em> more stuff ?
That's allready possible using the double single quote syntax, that is: stuff ''foobar'' more stuff
but I'm sure it's possible (though quite possibly difficult). My sloshing through the parser didn't go well.
On Sat, 16 Oct 2004 17:02:16 +0200, Felix Damrau mail@felixdamrau.de wrote:
Dear subscribers,
I want to add a new wiki-tag to my mediawiki. I thought that is quite easy but I a too stupid for that. The wiki Tag shoulb be like this:
I write: >>> text here <<< blabla. The three ">>>" shall word like the tags for emphasize. Where can I add now tags? Which files have to be edited? Can I format the text between the ">>>" Tags?
It would be great if there would be a starting tag <div id="bla"> and an ending Tag </div>
Can anyone give me an URL oder help me via eMail?
Thank you all, Felix Damrau _______________________________________________ MediaWiki-l mailing list MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
How do I delete an article that contains a ? in the title? And how do I prevent more of them from being created?
I created an article with a ? in the title. See
http://wise-nano.org/w/Category:Security_Policy_Implications_of_Nanotechnolo...
which contains the articles "Is there a superweapon" and "Is there a superweapon?"
I initially created the ?'d article. The system doesn't deal well with that. When I edited and saved the page, the page after the save said "There's no text here."
So I created the non-?'d version, and tried to delete the ?'d version - or maybe I tried to move the one to the other, I forget. Anyway, it didn't work. When I tried to delete the ?'d version, it deleted the non-?'d version. So I restored it.
Now the URL for the ?'d one ends in %3F but goes to the page without the ?. And when I try to delete the ?'d one, I can't (not that I ever could). And it's in a category, so I'm hesitant to hack it out of the database until I know exactly what to do to keep things consistent.
BTW, the article was created with a URL like this:
http://wise-nano.org/w?title=test%3F&makeArticle=Go%21&wpTextbox1=%5...
(You can click that URL, but PLEASE don't save it!)
That URL is weird because it was created by my easy-create-article hack (see the category page). But if I type [[test?]] it creates a URL like
http://wise-nano.org/w?title=Test%3F&action=edit
so I think this problem could happen in an unhacked wiki site too.
Thanks, Chris
On Oct 25, 2004, at 2:17 AM, Chris Phoenix wrote:
I initially created the ?'d article. The system doesn't deal well with that. When I edited and saved the page, the page after the save said "There's no text here."
Your rewrite rules are broken; you're probably sending the unescaped URL to index.php/$1, which will turn the ? and anything after it into a query string parameter.
Unfortunately Apache's mod_rewrite doesn't really deal with unescaping/reescaping in a sane fashion. If you change it to index.php?title=$1 then the ? case should work, but & will similarly fail, unless you patch Apache (there is a patch for Apache 1.x in the maintenance/ directory which adds an 'ampescape' function which escapes & to %26)
-- brion vibber (brion @ pobox.com)
Thanks. You correctly identified the problem. I've now got the following rules:
RewriteRule ^$ w RewriteRule ^w/stylesheets/(.*)$ path/stylesheets/$1 [L] RewriteRule ^w/images/(.*)$ path/images/$1 [L] RewriteRule ^w/(.*)$ path/index.php?title=$1 [L] RewriteRule ^w(.*)$ path/index.php$1 [L]
I think my host's Apache is quite broken. [L] doesn't stop processing (but doesn't seem to hurt anything). The reason my directory is called "path" instead of "wiki" is that a rule of
RewriteRule ^w(.*)$ wiki/index.php$1 [L]
will be applied multiple times (because 'wiki' starts with 'w'), expanding to wiki/index.phpiki/index.phpiki/index.php... until Apache throws an error. The recommended .htaccess file on the MediaWiki pages doesn't work for this reason.
When I tried to replace the final rule (with the bare w) with the rule:
RewriteRule ^w?(.*)$ wiki/index.php?$1 [L]
then http://wise-nano.org/w/Article served back the main page without style sheets, although all the other rules were unchanged. Go figure.
The RewriteCond feature doesn't seem to work at all.
But my rules seem to work OK, so the problem is "solved."
Chris
Brion Vibber wrote:
On Oct 25, 2004, at 2:17 AM, Chris Phoenix wrote:
I initially created the ?'d article. The system doesn't deal well with that. When I edited and saved the page, the page after the save said "There's no text here."
Your rewrite rules are broken; you're probably sending the unescaped URL to index.php/$1, which will turn the ? and anything after it into a query string parameter.
Unfortunately Apache's mod_rewrite doesn't really deal with unescaping/reescaping in a sane fashion. If you change it to index.php?title=$1 then the ? case should work, but & will similarly fail, unless you patch Apache (there is a patch for Apache 1.x in the maintenance/ directory which adds an 'ampescape' function which escapes & to %26)
-- brion vibber (brion @ pobox.com)
MediaWiki-l mailing list MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
On Oct 27, 2004, at 9:34 AM, Chris Phoenix wrote:
I think my host's Apache is quite broken. [L] doesn't stop processing (but doesn't seem to hurt anything).
Weird...
The reason my directory is called "path" instead of "wiki" is that a rule of
RewriteRule ^w(.*)$ wiki/index.php$1 [L]
That's a pretty odd rule: it will match any URL starting with a 'w' and indiscriminately paste the remainder to the end of "index.php". What's it for?
When I tried to replace the final rule (with the bare w) with the rule:
RewriteRule ^w?(.*)$ wiki/index.php?$1 [L]
This will match any URL at all, whether it has a 'w' at the start or not. (The ? means 'the previous character might or might not be there'.)
-- brion vibber (brion @ pobox.com)
On Mon, 25 Oct 2004 05:17:02 -0400, Chris Phoenix cphoenix@crnano.org wrote:
[cut] Now the URL for the ?'d one ends in %3F but goes to the page without the ?. And when I try to delete the ?'d one, I can't (not that I ever could). And it's in a category, so I'm hesitant to hack it out of the database until I know exactly what to do to keep things consistent. [cut]
This can easily be solved by removing all links to or from it, setting the page to "", etc. This should update everything except the page index. (of course, this doesn't help with old versions).
Also, try the url http://wise-nano.org/w?title=Is_there_a_superweapon%3F&action=delete
mediawiki-l@lists.wikimedia.org