This week I finished up all the tests required in admin window as well as added markdown support in mscolab chat. I also did some redesigning of the chat window. I also made a new window to show the history of all the changes for mscolab.
Most of my time last week was spent on how to implement the markdown feature. I looked at various different ways of implementing it. I was able to create rich text editor buttons for common features like bold, italics, underline and lists.
However, I ran into a big issue which was that PyQt's QTextEdit widget returned a massive HTML response even for a very small message. I didn't want to store such a huge response in the database as it contained several unwanted HTML tags and inline styles. I could not find a way to reduce this output so I had to completely change my approach.
I completely scrapped the button approach and moved on to allowing markdown syntax in the chat itself. I used the python-markdown library for converting markdown to HTML on the fly. I had to spend some time figuring out how to deregister any syntax I don't want to support as I only wanted support for bold, italics and lists. After going through the library's documentation and tutorials, I was able to get it all working🥳
After adding the markdown support, I removed some existing code which was made redundant after the addition of the admin dashboard and fixed the tests which were affected by this code.
This week, I would be working on adding other chat features like edit and delete messages and hopefully, if I am able to complete these features move on to finishing up the new change history window.