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.
This function is explicitly testing the percentage of a body, so should probably be re-defined as `test_body_percentage` or such.