{"id":7394,"library":"markdownlit","title":"markdownlit","description":"markdownlit is a Python library that enhances Streamlit's native Markdown capabilities by introducing 'lit' features such as magic links, colored text, collapsible content, and improved arrow/dash rendering. Built upon the `Python-Markdown` project, it is currently at version 0.0.7 and is actively maintained, though releases follow an irregular cadence.","status":"active","version":"0.0.7","language":"en","source_language":"en","source_url":"https://github.com/arnaudmiribel/markdownlit","tags":["streamlit","markdown","ui","utility","extension"],"install":[{"cmd":"pip install markdownlit","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Core functionality relies on Streamlit to render enhanced Markdown.","package":"streamlit","optional":false},{"reason":"Built upon the `Python-Markdown` project as its core Markdown parser.","package":"markdown","optional":false},{"reason":"Used for additional Markdown extensions, as indicated in `requirements.txt` of the project.","package":"pymdownx","optional":false}],"imports":[{"symbol":"mdlit","correct":"from markdownlit import mdlit"}],"quickstart":{"code":"import streamlit as st\nfrom markdownlit import mdlit\n\nst.set_page_config(layout=\"centered\")\nst.header(\"markdownlit Demo\")\n\nmdlit(\"You should definitely check out @(https://streamlit.io/) for building awesome apps!\")\nmdlit(\"Here is some [red]colored[/red] text and a [blue]magic link[/blue] to @(twitter.com/arnaudmiribel).\")\nmdlit(\"Is this cool -> right? And what about <- this?!\")","lang":"python","description":"To use `markdownlit`, import `mdlit` and use it as a drop-in replacement for `st.markdown()` to access its enhanced features like magic links, colored text, and custom arrows."},"warnings":[{"fix":"Upgrade `markdownlit` to v0.0.7 or later and ensure Streamlit is also up-to-date. Review and adapt any custom caching logic if `markdownlit`'s output was previously cached.","message":"Versions v0.0.6 and v0.0.7 included significant fixes related to Streamlit's caching primitives (`st.cache_data`, `st.cache_resource`). Applications using `markdownlit` with caching decorators might experience unexpected behavior or errors if not updated to match the latest Streamlit caching API and `markdownlit` versions. [cite: changelog]","severity":"breaking","affected_versions":"<0.0.7"},{"fix":"Upgrade `markdownlit` to v0.0.4 or later. If still encountering parsing issues, try to isolate if `streamlit-extras.mention` (or other HTML-injecting components) are conflicting and ensure both libraries are the latest compatible versions.","message":"Prior to v0.0.4, `markdownlit` had a dependency issue with `streamlit-extras`'s `mention` package, leading to potential XML parsing errors due to HTML conflicts. [cite: changelog]","severity":"gotcha","affected_versions":"<0.0.4"},{"fix":"Check Streamlit's official documentation for native colored text capabilities before deciding to use `markdownlit` specifically for this feature. For other unique features like magic links, `markdownlit` remains valuable.","message":"While `markdownlit` provides colored text, Streamlit now offers native support for colored text within `st.markdown()` using similar syntax. Users should be aware they might not need `markdownlit` solely for this feature in newer Streamlit versions.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Add `from markdownlit import mdlit` at the top of your Streamlit script.","cause":"The `mdlit` function was not imported from the `markdownlit` library.","error":"NameError: name 'mdlit' is not defined"},{"fix":"Ensure both `markdownlit` (v0.0.7+) and Streamlit are updated to their latest versions. Review your code for deprecated caching decorators (`st.cache` should be `st.cache_data` or `st.cache_resource`).","cause":"This error often indicates an incompatibility between your `markdownlit` version and Streamlit's caching API, which underwent changes.","error":"AttributeError: module 'streamlit' has no attribute 'cache_data' (or similar caching errors)"},{"fix":"Upgrade `markdownlit` to v0.0.4 or newer. If the problem persists, examine other Streamlit components or custom HTML that might conflict with Markdown parsing, especially those that dynamically alter HTML structure.","cause":"This might be related to `markdownlit`'s interaction with other components that inject HTML, specifically a known issue with `streamlit-extras`'s `mention` package in older versions.","error":"XMLSyntaxError: Start tag expected, '<' not found (or similar parsing/rendering issues)"}]}