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.
I agree that changing it from `code_percentage` is a good idea, but is there a better name than just `percentage`? Not sure, but it sounds ambiguous. Maybe something like `string_percentage`? 

Also, could you add a docstring for it? As we go on, we should be adding docstrings to whatever we do. I will go back myself and add docstring to bits that don't have them later on.