def highlight(text: str, marked: bool = True) -> str: """Add/remove mark indicator from text. If marked is True, then the indicator is added to the left of the text. Otherwise it is removed. """ mark_str = Mark.indicator() + " " text = remove_prefix(text, mark_str) return mark_str + text if marked else text
def test_remove_prefix_not_found(): assert utils.remove_prefix("start hello", "starter") == "start hello"
def test_remove_prefix(): assert utils.remove_prefix("start hello", "start") == " hello"