Skip to content

data-tooltip does not support multiline text / newline characters #10808

Description

@jiang3li4

Describe the bug

The data-tooltip attribute used to create tooltips in Marimo does not support multiline content. Newline characters (including \n and the HTML entity ) are not rendered as line breaks inside the tooltip — the tooltip always displays as a single line regardless of the content.

Will you submit a PR?

  • Yes

Environment

{
"marimo": "0.23.1",
"editable": false,
"location": "/home/vsc/marimo_notebooks/.pixi/envs/default/lib/python3.12/site-packages/marimo",
"OS": "Linux",
"OS Version": "5.14.0-687.42.1.el9_8.x86_64",
"Processor": "x86_64",
"Python Version": "3.12.13",
"Locale": "--",
"Binaries": {
"Browser": "152.0.7977.82",
"Node": "v26.3.0",
"uv": "0.11.4 (x86_64-unknown-linux-musl)"
},
"Dependencies": {
"click": "8.2.2",
"docutils": "0.22",
"itsdangerous": "2.2.0",
"jedi": "0.19.2",
"markdown": "3.8.2",
"narwhals": "2.0.1",
"packaging": "25.0",
"psutil": "5.9.8",
"pygments": "2.19.2",
"pymdown-extensions": "10.21.3",
"pyyaml": "6.0.2",
"starlette": "0.47.2",
"tomlkit": "0.13.3",
"typing-extensions": "4.15.0",
"uvicorn": "0.35.0",
"websockets": "15.0.1"
},
"Optional Dependencies": {
"altair": "5.5.0",
"anywidget": "0.11.0",
"duckdb": "0.10.2",
"loro": "1.13.1",
"mcp": "1.27.2",
"openai": "1.109.1",
"pandas": "2.3.1",
"polars": "1.41.2",
"pyarrow": "24.0.0",
"pytest": "8.4.1",
"ruff": "0.12.7",
"sqlglot": "27.20.0"
},
"Experimental Flags": {}
}

Code to reproduce

import marimo as mo

data = [
    {
        "row_id": mo.md('<div data-tooltip="This is row A&#10; info">row_a</div>'),
        "value": 42,
    },
    {
        "row_id": mo.md('<div data-tooltip="This is row B\n info">row_b</div>'),
        "value": 17,
    },
    {
        "row_id": mo.Html('<div data-tooltip="This is row C\n info">row_c</div>'),
        "value": 33,
    },
]

table = mo.ui.table(data=data)
table

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions