Beispiel #1
0
    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
Beispiel #2
0
def test_remove_prefix_not_found():
    assert utils.remove_prefix("start hello", "starter") == "start hello"
Beispiel #3
0
def test_remove_prefix():
    assert utils.remove_prefix("start hello", "start") == " hello"