#11041·marimo

Markdown links with custom schemes (zotero://) lose their href

Author: jaehhoCreated Sep 30, 2026Updated Sep 30, 2026

Describe the bug

Markdown links with a custom scheme (zotero://…) render as link text but lose their href. Clicking does nothing. The same URL works when pasted into the browser address bar.

Python keeps the href; the frontend DOMPurify config uses the default ALLOWED_URI_REGEXP, which allows http(s), mailto, tel, callto, sms, cid, xmpp, matrix and drops everything else on href. The rehype-sanitize path is similar.

python
import marimo as mo

mo.md(
    "[PDF](zotero://open-pdf/library/items/IDT2EG5W?page=1&annotation=AS2FBX8Q)"
)

Expected: a working zotero:// link (OS protocol handler). Actual: an anchor with no usable href.

Are you willing to submit a PR?

I have not started one. Happy to if a maintainer confirms the direction (extra schemes on an allowlist, a config option, or stop rewriting href for unknown schemes while still blocking javascript: / data:).

Environment

json
{
  "marimo": "0.25.0",
  "editable": false,
  "location": "/home/jaeho/.cache/uv/archive-v0/9w0_K3yJuaO41cQ7rwNSC/lib/python3.13/site-packages/marimo",
  "OS": "Linux",
  "OS Version": "7.2.7-arch1-1",
  "Processor": "",
  "Python Version": "3.13.12",
  "Locale": "en_US",
  "Binaries": {
    "Browser": "--",
    "Node": "v26.10.0",
    "uv": "0.10.12 (x86_64-unknown-linux-gnu)"
  },
  "Dependencies": {
    "click": "8.5.0",
    "docutils": "0.23",
    "itsdangerous": "2.2.0",
    "jedi": "0.20.0",
    "markdown": "3.11",
    "narwhals": "2.26.0",
    "packaging": "26.3",
    "psutil": "7.2.2",
    "pygments": "2.21.0",
    "pymdown-extensions": "11.0.2",
    "pyyaml": "6.0.3",
    "starlette": "1.7.0",
    "tomlkit": "0.15.1",
    "typing-extensions": "4.16.0",
    "uvicorn": "0.54.0",
    "websockets": "17.1"
  },
  "Optional Dependencies": {
    "loro": "1.16.2"
  },
  "Experimental Flags": {}
}

Code to reproduce

python
# /// script
# requires-python = ">=3.11"
# dependencies = ["marimo"]
# ///

import marimo as mo

app = mo.app()


@app.cell
def _():
    mo.md(
        "[PDF](zotero://open-pdf/library/items/IDT2EG5W?page=1&annotation=AS2FBX8Q)"
    )
    return


if __name__ == "__main__":
    app.run()