I am working on a Ruby client for the MediaWiki API and was having that same problem for a long time. I'm not good enough with YAML to have fixed it, so I switched to XML. I recall the problem having to do with YAML formatting as opposed to the content of the message, so you may have found a second bug. There is a class of the API dedicated to YAML formatting, so you can look through it for a place to clean output (if you're comfortable with PHP).
Briefly on XML- I have found that it wasn't so bad to switch from YAML to XML. I know that YAML is attactive for how simple it is, but really XML isn't so bad either. My two cents.
-Eddie
On Thu, Mar 13, 2008 at 9:55 AM, L. Cleophas mdwkapi@loekcleophas.com wrote:
Hi
I've been trying to use the API to get output into YAML format for processing in Ruby. Seems (see http://bugzilla.wikimedia.org/show_bug.cgi?id=12120 ) that the API's YAML output is broken, as it does not escape quotes, colons followed by spaces etc. This causes output like
title: Job: A Comedy of Justice
when getting the Wikipedia page with that title; due to the unescaped second colon followed by space, Ruby's YAML.load chokes on this. Seems to me that this basically means that YAML output is not usable for getting data from wikipedia, quite a few of whose articles use ": " in titles or other fields.
Any thoughts on how to circumvent this (without using XML as format; I know I can parse this from Ruby using REXML, but it ain't nearly as easy/clean as YAML), or on a time horizon for a fix/update?
Any help or suggestions are appreciated, thanks,
Loek Cleophas
Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api