Skip to content

[Nightly] Streaming Markdown completion displays (streamdown:incomplete-link) #14460

@MathCatsAnd

Description

@MathCatsAnd

Checklist

  • I have searched the existing issues for similar issues.
  • I added a very descriptive title to this issue.
  • I have provided sufficient information below to help reproduce this issue.

Summary

When using Streamlit's color directives, combined with Markdown completion in st.write_stream, (streamdown:incomplete-link) is visible. Additionally, nested directives aren't completed correctly.

Reproducible Code Example

import streamlit as st
import time

options = {
  "italic": "This is a *Foo bar and baz bat*",
  "bold": "This is a **Foo bar and baz bat**",
  "bold_italic": "This is a ***Foo bar and baz bat***",
  "color": "This is a :red[Foo bar and baz bat]",
  "highlight": "This is a :red-background[Foo bar and baz bat]",
  "color_highlight": "This is a :red-background[:rainbow[Foo bar and baz bat]]",
  "color_custom": "This is a :color[Foo bar and baz bat]{foreground='rgb(0, 100, 200)'}",
  "small": "This is a :small[Foo bar and baz bat]"
}

x = st.selectbox("text", options.keys())

def gen():
    for token in options[x].split(" "):
        time.sleep(.5)
        yield token + " "

st.write_stream(gen)

Steps To Reproduce

Run the app and try each option. Italic, bold, and bold-italic are fine by themselves, but the others have trailing artifacts and don't complete correctly when nested.

Expected Behavior

No response

Current Behavior

2026-03-22_22-53-38.mp4

Is this a regression?

  • Yes, this used to work in a previous version.

Debug info

  • Streamlit version: Nightly 1.55.1.dev20260321
  • Python version: 3.11
  • Operating System: Windows
  • Browser: Chrome

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature:st.write_streamRelated to `st.write_stream`priority:P2Medium-high priority - fix within one monthstatus:confirmedBug has been confirmed by the Streamlit teamtype:bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions