HTML escape Token values #298

Open
Kapeli opened this Issue Jan 1, 2013 · 1 comment

2 participants

@Kapeli

Hi there,

I've received an email from a user which complained that a appledoc docset is not showing all entries inside its index. I tried running docsetutil index over it and docsetutil gave a XML parsing error.

I don't think appledoc HTML escapes special characters inside the Tokens.xml entries.

So, for example, if something like this gets into Tokens.xml:

<Abstract>Use this method to check if count is < 1</Abstract>

docsetutil will throw out a XML parse error complaining that < is an invalid element and will only partially index the docset.

I've looked over appledoc's code but I can't say I understand it enough to make this change. In a nutshell, you should HTML escape any symbols inside the strings you write as values for the XML, e.g. inside Abstract elements.

What do you think? Shouldn't this be something that appledoc should handle?

If you can point me in the right direction of where I should HTML encode the strings that get written inside Tokens.xml, I'll submit a pull request.

@tomaz
Owner

There is some escaping implemented at this point, but it's not including all symbols. I do it case by case :) Will need to check if there's some method that takes care of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment