mongodb / chatbot

MongoDB Chatbot Framework. Powered by MongoDB and Atlas Vector Search.
https://mongodb.github.io/chatbot/
Apache License 2.0
106 stars 48 forks source link

(EAI-349) [UI] Disable setext headings in LGMarkdown #423

Closed nlarew closed 4 weeks ago

nlarew commented 1 month ago

Jira: (EAI-349) [UI] Disable setext headings in LGMarkdown

Changes

Overview

Given this markdown text:

# This is an H1 (ATX)

Lorem ipsum.

## This is an H2 (ATX)

Dolor sit amet.

### This is an H3 (ATX)

consectetur adipiscing elit, sed do eiusmod tempor.

This is an H1 (Setext)
-------

This is an H2 (Setext)
=======

Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris.

We can see in a before and after that ATX style headings are rendered as headings whlie setext style headings are just paragraphs.

B A - Setext Headings

Demo

Before

https://github.com/mongodb/chatbot/assets/15657698/1d552219-164e-4f2d-b33b-1a10ccbd2a23

After

https://github.com/mongodb/chatbot/assets/15657698/88c4fe54-3087-4fbb-b6f0-1fbaf8c8a547

nlarew commented 1 month ago

should this change be added to the lg-chat package at some point?

I think it's better left to implementers for now. If more people have streaming markdown cases that encounter this we could package up this remark plugin for them but I think lg-markdown should support as much of "standard" markdown as possible out of the box.