2003-06-21

Been fixing OddMuse again, to make it possible to link references to Swiss law. Example:

OddMuse

Art. 2 Abs. 3 URG

This should link to the page Art._2_URG​#3 – note the anchor for the paragraph referred to.

In order to create these anchors, I also wrote a new rule for them:

[#3]

This gets replaced with an anchor having the name “3” and the content “§3”.

All of this as a potential extension in the config file only, of course. I needed this for the openlaw wiki we are trying to start here in Switzerland:

http://www.openlaw.ch/cgi-bin/openlaw.pl

This is where I discovered some more CGI.pm quirks – eg. if you have a pagename containing a dot, such as Art._2_URG, and the dot is URL-encoded as %2e, then CGI.pm will get confused and think that Art._2_URG is the filename, not test.pl or wiki.pl or whatever. I also forgot to replace spaces with underlines, so spaces where being encoded as %20, and then $q→keywords started returning only “Art.” (the first keyword), until I started joining all keywords using a space again... In the end I am not sure what was really required, and I don’t feel like investigating. But I’m leaving the code in, should other people make these mistakes. Fault-tolerant is better.