def _check_true_dir(self, text):
        is_rtl = False
        is_ltr = False
        quoted_text = False

        last_inline_html_char_pos = text.rfind(">")
        if -1 > last_inline_html_char_pos:
            it_here = text[last_inline_html_char_pos+1:]
        else:
            it_here = text

        for ch in it_here:
            res = UD.bidirectional(ch)
            if ch == '"':
                quoted_text = not quoted_text
            elif not quoted_text and res in {'R', 'AL'}:
                is_rtl = True
            elif not quoted_text and res == 'L':
                is_ltr = True

        #print(text, it_here, is_rtl, is_ltr)

        if is_rtl:
            return 'rtl'
        elif is_ltr:
            return 'ltr'
        else:
            return 'auto'
dataset/ETHPy150Open ShadowKyogre/mikidown/mikidown/mdx_autodir.py/AutoTextDirectionTreeprocessor._check_true_dir/swapped operands of `>`