<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def remove_html_markup(text, replacechar=' ', remove_escaped_chars_p=True):
 """ Remove HTML markup from text. @param text: Input text. @type text: string. @param replacechar: By which character should we replace HTML markup. Usually, a single space or an empty string are nice values. @type replacechar: string @param remove_escaped_chars_p: If True, also remove escaped characters like '&amp;', '&lt;', '&gt;' and '&quot;'. @type remove_escaped_chars_p: boolean @return: Input text with HTML markup removed. @rtype: string """

    if not remove_escaped_chars_p:
        return RE_HTML_WITHOUT_ESCAPED_CHARS.sub(replacechar, text)
    return RE_HTML.sub(replacechar, text)