Closed aaronr7734 closed 8 months ago
This would be an easy feature to add, or first contribution if someone gets to it before I do. Tasks would include:
markdown.markdown
, which doesn't seem to raise an exception. Even on empty input, text is wrapped in a paragraph as we would expect so there is no need to check whether the response adheres to a certain format.isHtml=True
to the call to ui.browseableMessage
I was trying to work on this, and it was harder than expected. NVDA bundles an incomplete version of html with html.parser missing, which markdown needs. I've tried inserting module path at 0 to make it load the html module I copied, but that doesn't work either. It seems it always imports the bundled html in NVDA. I've thought of modifying the copied html and renaming it and modifying markdown to import it instead, but I'm not sure about it and how it'll be affected by markdown updates, the latest version of markdown that supports 3.7 is 3.4.4 so that might be not an issue. Is there another solution or this solution is acceptable? Thank you.
Thanks @mzanm for taking this on.
There is another option that would preserve compatibility with later versions of the markdown module, but it requires pulling in extra dependencies and pieces of the standard library that NVDA does not, along with some annoyingly hacky tampering with sys.modules
. Once I have more time, I'll see if I can get it working and let you know the result.
There are many situations where I've had GPT4 create tables, organize text into headings and lists, etc. Yes, even for image descriptions. Markdown is the most token efficient way to do this. So I was wondering if for those of us using the browseableMessage if you could come up with a way to render this.
One way I've briefly explored is using Markdown (the python module) to convert GPT's output to html, then displaying that html via isHtml on the browseableMessage. Thoughts?