feat(DuoChat): Add default markdown renderer for streaming messages
While we consume streaming messages, we render markdown on the fly in the frontend. Once the message is finally rendered by the backend, we will consume some rendered HTML. One of the problems we are facing now, that if a streamed message contains code blocks for example, the code blocks might note be closed yet and comments might be rendered as headings: ~~~~md ```yaml # this is not a headline ~~~~ will be rendered as: ~~~~html <p>```yaml</p> <h1>this is not a headline</h1> ~~~~ Luckily the CommonMark spec, which `marked` follows, considers the end of a markdown document as closing the open code block. So we do not need to worry about: gitlab#433338 In order to achieve consistent behavior between our current usages of Duo Chat, we add a default markdown renderer to Duo Chat. This will help us solve gitlab-vscode-extension#1227 more easily while also ensuring that we can quickly fix rendering issues like the aforementioned codeblock issue in a single place. In order to ensure that the markdown render doesn't "pollute" other components, we lint against imports and add a message that it is only supposed to be used in Duo Chat.
Loading
-
mentioned in commit cc056847
-
mentioned in merge request status-page!893 (merged)
-
mentioned in merge request gitlab!144286 (merged)
-
mentioned in merge request gitlab-docs!4595 (closed)
-
mentioned in merge request gitlab!144649 (merged)
-
mentioned in merge request gitlab-org/gitlab-services/design.gitlab.com!3745 (merged)
-
mentioned in merge request gitlab-org/frontend/playground/accessibility-scanner!26 (closed)
-
mentioned in merge request gitlab-org/frontend/pajamas-adoption-scanner!300 (merged)
Please register or sign in to comment