added get_markup method

this method is not much readable. i didn't found any other way to do it. alternate solution is to use HTMLParser and it adds a lot of code.

renamed code_percentage to percentage so  that both code and markup can use the method.
As pointed out by DSM, using the variable names `str1` and `str2` is probably bad as they're not strings, they're lists.