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.