Closed tancnle closed 1 year ago
👋🏼 @Erotemic could you verify if this addresses the reported issue? 🙏🏼
This looks great!
I'm perfectly happy with this as-is. The only thing I might suggest is that the "want" part of the doctest where you specify the expected result would be more readable if it was distinguished from the rest of the string by a different color. For example vim does it this way:
The logic would be that a "want" statement starts after the last >>>
or ...
prefix (except in the case where the line is only ...
in which case it should be interpreted as an ellipsis - but that is an edge case that could be ignored) and ends whenever there is a blank newline.
However, if that's difficult to implement, then this addresses 99% of the problem and is a huge readability improvement! I can't wait to be able to read my doctests on gitlab!
Thank you for the insights @Erotemic. I have rejigged the PR to provide better support for test output. I have also ensured the lexer can distinguish between ...
as a prompt and a builtin. Let me know what you think.
Add support to highlight
doctest
in Python lexer.Resolves https://github.com/rouge-ruby/rouge/issues/920