{ "issue": { "url": "https://api.github.com/repos/laurent22/joplin/issues/14397", "repository_url": "https://api.github.com/repos/laurent22/joplin", "labels_url": "https://api.github.com/repos/laurent22/joplin/issues/14397/labels{/name}", "comments_url": "https://api.github.com/repos/laurent22/joplin/issues/14397/comments", "events_url": "https://api.github.com/repos/laurent22/joplin/issues/14397/events", "html_url": "https://github.com/laurent22/joplin/pull/14397", "id": 3967386023, "node_id": "PR_kwDOBLftOs7FGvOU", "number": 14397, "title": "Mobile: Fixes #14187: Fix table style/border/class attributes being lost in RTE", "user": { "login": "SohamJuneja", "id": 138424822, "node_id": "U_kgDOCEAx9g", "avatar_url": "https://avatars.githubusercontent.com/u/138424822?v=4", "gravatar_id": "", "url": "https://api.github.com/users/SohamJuneja", "html_url": "https://github.com/SohamJuneja", "followers_url": "https://api.github.com/users/SohamJuneja/followers", "following_url": "https://api.github.com/users/SohamJuneja/following{/other_user}", "gists_url": "https://api.github.com/users/SohamJuneja/gists{/gist_id}", "starred_url": "https://api.github.com/users/SohamJuneja/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/SohamJuneja/subscriptions", "organizations_url": "https://api.github.com/users/SohamJuneja/orgs", "repos_url": "https://api.github.com/users/SohamJuneja/repos", "events_url": "https://api.github.com/users/SohamJuneja/events{/privacy}", "received_events_url": "https://api.github.com/users/SohamJuneja/received_events", "type": "User", "user_view_type": "public", "site_admin": false }, "labels": [ { "id": 519700741, "node_id": "MDU6TGFiZWw1MTk3MDA3NDE=", "url": "https://api.github.com/repos/laurent22/joplin/labels/bug", "name": "bug", "color": "cf353b", "default": true, "description": "It's a bug" }, { "id": 1079605111, "node_id": "MDU6TGFiZWwxMDc5NjA1MTEx", "url": "https://api.github.com/repos/laurent22/joplin/labels/mobile", "name": "mobile", "color": "ffc274", "default": false, "description": "All mobile platforms" }, { "id": 1366672371, "node_id": "MDU6TGFiZWwxMzY2NjcyMzcx", "url": "https://api.github.com/repos/laurent22/joplin/labels/editor", "name": "editor", "color": "91ca55", "default": false, "description": "" }, { "id": 1802916084, "node_id": "MDU6TGFiZWwxODAyOTE2MDg0", "url": "https://api.github.com/repos/laurent22/joplin/labels/renderer", "name": "renderer", "color": "91ca55", "default": false, "description": "About the note renderer" }, { "id": 2153491154, "node_id": "MDU6TGFiZWwyMTUzNDkxMTU0", "url": "https://api.github.com/repos/laurent22/joplin/labels/import", "name": "import", "color": "91ca55", "default": false, "description": "Related to importing files such as ENEX, JEX, etc." }, { "id": 2431153506, "node_id": "MDU6TGFiZWwyNDMxMTUzNTA2", "url": "https://api.github.com/repos/laurent22/joplin/labels/plugins", "name": "plugins", "color": "91ca55", "default": false, "description": "Anything related to Joplin's plugin system" }, { "id": 5991245949, "node_id": "LA_kwDOBLftOs8AAAABZRsofQ", "url": "https://api.github.com/repos/laurent22/joplin/labels/markdown-editor", "name": "markdown-editor", "color": "91ca55", "default": false, "description": "About the Markdown editor" } ], "state": "closed", "locked": false, "assignees": [], "milestone": null, "comments": 11, "created_at": "2026-02-20T08:57:09Z", "updated_at": "2026-03-17T12:54:41Z", "closed_at": "2026-03-01T12:25:03Z", "assignee": null, "author_association": "NONE", "active_lock_reason": null, "draft": false, "pull_request": { "url": "https://api.github.com/repos/laurent22/joplin/pulls/14397", "html_url": "https://github.com/laurent22/joplin/pull/14397", "diff_url": "https://github.com/laurent22/joplin/pull/14397.diff", "patch_url": "https://github.com/laurent22/joplin/pull/14397.patch", "merged_at": null }, "body": "## AI Assistance Disclosure\r\n\r\nUsed AI as a reference while navigating unfamiliar parts of the codebase. All code changes were written, reviewed, and tested by me.\r\n\r\n## What was happening\r\n\r\nWhen you created a table in the desktop RTE with a background colour (or any inline `style`) and then opened the same note on mobile and made any edit, the style was wiped on save.\r\n\r\nThere were two separate places stripping the attributes:\r\n\r\n1. **ProseMirror schema** (`packages/editor/ProseMirror/schema.ts`) — the `table` node override had no `getAttrs` in `parseDOM`, so `style`, `border` and `class` were silently discarded when the HTML was loaded into the editor. \r\n\r\n2. **Turndown GFM plugin** (`packages/turndown-plugin-gfm/src/tables.js`) — `tableShouldBeHtml()` only kept tables as HTML when they contained complex block elements (lists, headings, code, etc.).\r\n\r\n## What this PR changes\r\n\r\n- `schema.ts`: added `style`, `border` and `class` to the `table` node attrs, wired up `getAttrs` in `parseDOM` to capture them, and updated `toDOM` to re-emit them.\r\n\r\n- `tables.js`: added an early `return true` in `tableShouldBeHtml()` when the table node has a `style` attribute, so styled tables are always kept as HTML.\r\n\r\n- `schema.test.ts`: new regression test that creates an editor with a styled table and asserts the three attributes survive a parse → serialize round-trip.\r\n\r\nFIX:\r\nMarkdown:
Test Task |
Test Task Soham |