{
	"issue": {
		"url": "https://api.github.com/repos/laurent22/joplin/issues/8213",
		"repository_url": "https://api.github.com/repos/laurent22/joplin",
		"labels_url": "https://api.github.com/repos/laurent22/joplin/issues/8213/labels{/name}",
		"comments_url": "https://api.github.com/repos/laurent22/joplin/issues/8213/comments",
		"events_url": "https://api.github.com/repos/laurent22/joplin/issues/8213/events",
		"html_url": "https://github.com/laurent22/joplin/pull/8213",
		"id": 1716407279,
		"node_id": "PR_kwDOBLftOs5Q2SB2",
		"number": 8213,
		"title": "All: Fixes #6431: Preserve Table Alignment When Editing a Note With the Rich Text Editor",
		"user": {
			"login": "christopher-o-toole",
			"id": 22433652,
			"node_id": "MDQ6VXNlcjIyNDMzNjUy",
			"avatar_url": "https://avatars.githubusercontent.com/u/22433652?v=4",
			"gravatar_id": "",
			"url": "https://api.github.com/users/christopher-o-toole",
			"html_url": "https://github.com/christopher-o-toole",
			"followers_url": "https://api.github.com/users/christopher-o-toole/followers",
			"following_url": "https://api.github.com/users/christopher-o-toole/following{/other_user}",
			"gists_url": "https://api.github.com/users/christopher-o-toole/gists{/gist_id}",
			"starred_url": "https://api.github.com/users/christopher-o-toole/starred{/owner}{/repo}",
			"subscriptions_url": "https://api.github.com/users/christopher-o-toole/subscriptions",
			"organizations_url": "https://api.github.com/users/christopher-o-toole/orgs",
			"repos_url": "https://api.github.com/users/christopher-o-toole/repos",
			"events_url": "https://api.github.com/users/christopher-o-toole/events{/privacy}",
			"received_events_url": "https://api.github.com/users/christopher-o-toole/received_events",
			"type": "User",
			"user_view_type": "public",
			"site_admin": false
		},
		"labels": [],
		"state": "closed",
		"locked": true,
		"assignee": null,
		"assignees": [],
		"milestone": null,
		"comments": 3,
		"created_at": "2023-05-18T23:40:21Z",
		"updated_at": "2023-05-19T01:20:45Z",
		"closed_at": "2023-05-19T01:18:23Z",
		"author_association": "CONTRIBUTOR",
		"sub_issues_summary": {
			"total": 0,
			"completed": 0,
			"percent_completed": 0
		},
		"active_lock_reason": null,
		"draft": false,
		"pull_request": {
			"url": "https://api.github.com/repos/laurent22/joplin/pulls/8213",
			"html_url": "https://github.com/laurent22/joplin/pull/8213",
			"diff_url": "https://github.com/laurent22/joplin/pull/8213.diff",
			"patch_url": "https://github.com/laurent22/joplin/pull/8213.patch",
			"merged_at": null
		},
		"body": "<!--\r\n\r\nPlease prefix the title with the platform you are targetting:\r\n\r\nHere are some examples of good titles:\r\n\r\n- Desktop: Resolves #123: Added new setting to change font\r\n- Mobile, Desktop: Fixes #456: Fixed config screen error\r\n- All: Resolves #777: Made synchronisation faster\r\n\r\nAnd here's an explanation of the title format:\r\n\r\n- \"Desktop\" for the Windows/macOS/Linux app (Electron app)\r\n- \"Mobile\" for the mobile app (or \"Android\" / \"iOS\" if the pull request only applies to one of the mobile platforms)\r\n- \"CLI\" for the CLI app\r\n\r\nIf it's two platforms, separate them with commas - \"Desktop, Mobile\" or if it's for all platforms, prefix with \"All\".\r\n\r\nIf it's not related to any platform (such as a translation, change to the documentation, etc.), simply don't add a platform.\r\n\r\nThen please append the issue that you've addressed or fixed. Use \"Resolves #123\" for new features or improvements and \"Fixes #123\" for bug fixes.\r\n\r\nAND PLEASE READ THE GUIDE: https://github.com/laurent22/joplin/blob/dev/CONTRIBUTING.md\r\n\r\n-->\r\n\r\nFixes #6431 \r\n\r\n## Problem\r\n\r\nThe text alignment of table columns is not preserved when editing a note with the rich text editor. This occurs due to the following issues with how HTML tables are converted to markdown:\r\n\r\n- The markdown renderer used by Joplin aligns text using the CSS [text-align property](https://developer.mozilla.org/en-US/docs/Web/CSS/text-align), but `turndown-plugin-gfm` only checks if text is aligned via the deprecated HTML align attribute.\r\n- The alignment of a table cell's text is not checked unless the maximum number of columns in any of the table's rows in less than the number of columns in the heading row. This is always false so the alignment is never checked.\r\n- When a table has no heading row, a heading is added to make the table valid markdown. The procedure has two problems: headers whose first column is left-aligned or center-aligned aren't detected and the heading added is always unaligned regardless of how the text in the table is aligned.\r\n\r\n## Solution\r\n- Check whether cells are aligned using the `text-align` property and make it so any valid cell node is retrieved and checked.\r\n- Expand the missing header check to account for cases in which the first column is left or center aligned.\r\n- Select the most frequently used alignment as the alignment for each table column. This accounts for cases in which the user aligns most but not all cells using the rich text editor UI. \r\n  - Note: While you could align text of individual cells using HTML, picking the most frequent way text in a column is aligned is a sensible way to achieve a conversion to pure markdown while allowing some flexibility/resiliency. \r\n",
		"closed_by": {
			"login": "christopher-o-toole",
			"id": 22433652,
			"node_id": "MDQ6VXNlcjIyNDMzNjUy",
			"avatar_url": "https://avatars.githubusercontent.com/u/22433652?v=4",
			"gravatar_id": "",
			"url": "https://api.github.com/users/christopher-o-toole",
			"html_url": "https://github.com/christopher-o-toole",
			"followers_url": "https://api.github.com/users/christopher-o-toole/followers",
			"following_url": "https://api.github.com/users/christopher-o-toole/following{/other_user}",
			"gists_url": "https://api.github.com/users/christopher-o-toole/gists{/gist_id}",
			"starred_url": "https://api.github.com/users/christopher-o-toole/starred{/owner}{/repo}",
			"subscriptions_url": "https://api.github.com/users/christopher-o-toole/subscriptions",
			"organizations_url": "https://api.github.com/users/christopher-o-toole/orgs",
			"repos_url": "https://api.github.com/users/christopher-o-toole/repos",
			"events_url": "https://api.github.com/users/christopher-o-toole/events{/privacy}",
			"received_events_url": "https://api.github.com/users/christopher-o-toole/received_events",
			"type": "User",
			"user_view_type": "public",
			"site_admin": false
		},
		"reactions": {
			"url": "https://api.github.com/repos/laurent22/joplin/issues/8213/reactions",
			"total_count": 0,
			"+1": 0,
			"-1": 0,
			"laugh": 0,
			"hooray": 0,
			"confused": 0,
			"heart": 0,
			"rocket": 0,
			"eyes": 0
		},
		"timeline_url": "https://api.github.com/repos/laurent22/joplin/issues/8213/timeline",
		"performed_via_github_app": null,
		"state_reason": null
	},
	"comments": [
		{
			"url": "https://api.github.com/repos/laurent22/joplin/issues/comments/1553784509",
			"html_url": "https://github.com/laurent22/joplin/pull/8213#issuecomment-1553784509",
			"issue_url": "https://api.github.com/repos/laurent22/joplin/issues/8213",
			"id": 1553784509,
			"node_id": "IC_kwDOBLftOs5cnN69",
			"user": {
				"login": "github-actions[bot]",
				"id": 41898282,
				"node_id": "MDM6Qm90NDE4OTgyODI=",
				"avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4",
				"gravatar_id": "",
				"url": "https://api.github.com/users/github-actions%5Bbot%5D",
				"html_url": "https://github.com/apps/github-actions",
				"followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers",
				"following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}",
				"gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}",
				"starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}",
				"subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions",
				"organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs",
				"repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos",
				"events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}",
				"received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events",
				"type": "Bot",
				"user_view_type": "public",
				"site_admin": false
			},
			"created_at": "2023-05-18T23:40:36Z",
			"updated_at": "2023-05-18T23:44:23Z",
			"author_association": "CONTRIBUTOR",
			"body": "**CLA Assistant Lite bot:** <br/>Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you all sign our [Contributor License Agreement](https://github.com/laurent22/joplin/blob/dev/readme/cla.md) before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.<br/>\n   - - -\n   I have read the CLA Document and I hereby sign the CLA\n   - - -\n   **1** out of **2** committers have signed the CLA.<br/>:white_check_mark: @christopher-o-toole<br/>:x: @Christopher OToole<br/>**Christopher OToole** seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please [add the email address used for this commit to your account](https://help.github.com/articles/why-are-my-commits-linked-to-the-wrong-user/#commits-are-not-linked-to-any-user).<br/><sub>You can retrigger this bot by commenting **recheck** in this Pull Request</sub>",
			"reactions": {
				"url": "https://api.github.com/repos/laurent22/joplin/issues/comments/1553784509/reactions",
				"total_count": 0,
				"+1": 0,
				"-1": 0,
				"laugh": 0,
				"hooray": 0,
				"confused": 0,
				"heart": 0,
				"rocket": 0,
				"eyes": 0
			},
			"performed_via_github_app": null
		},
		{
			"url": "https://api.github.com/repos/laurent22/joplin/issues/comments/1553786297",
			"html_url": "https://github.com/laurent22/joplin/pull/8213#issuecomment-1553786297",
			"issue_url": "https://api.github.com/repos/laurent22/joplin/issues/8213",
			"id": 1553786297,
			"node_id": "IC_kwDOBLftOs5cnOW5",
			"user": {
				"login": "christopher-o-toole",
				"id": 22433652,
				"node_id": "MDQ6VXNlcjIyNDMzNjUy",
				"avatar_url": "https://avatars.githubusercontent.com/u/22433652?v=4",
				"gravatar_id": "",
				"url": "https://api.github.com/users/christopher-o-toole",
				"html_url": "https://github.com/christopher-o-toole",
				"followers_url": "https://api.github.com/users/christopher-o-toole/followers",
				"following_url": "https://api.github.com/users/christopher-o-toole/following{/other_user}",
				"gists_url": "https://api.github.com/users/christopher-o-toole/gists{/gist_id}",
				"starred_url": "https://api.github.com/users/christopher-o-toole/starred{/owner}{/repo}",
				"subscriptions_url": "https://api.github.com/users/christopher-o-toole/subscriptions",
				"organizations_url": "https://api.github.com/users/christopher-o-toole/orgs",
				"repos_url": "https://api.github.com/users/christopher-o-toole/repos",
				"events_url": "https://api.github.com/users/christopher-o-toole/events{/privacy}",
				"received_events_url": "https://api.github.com/users/christopher-o-toole/received_events",
				"type": "User",
				"user_view_type": "public",
				"site_admin": false
			},
			"created_at": "2023-05-18T23:44:06Z",
			"updated_at": "2023-05-18T23:44:06Z",
			"author_association": "CONTRIBUTOR",
			"body": "I have read the CLA Document and I hereby sign the CLA",
			"reactions": {
				"url": "https://api.github.com/repos/laurent22/joplin/issues/comments/1553786297/reactions",
				"total_count": 0,
				"+1": 0,
				"-1": 0,
				"laugh": 0,
				"hooray": 0,
				"confused": 0,
				"heart": 0,
				"rocket": 0,
				"eyes": 0
			},
			"performed_via_github_app": null
		},
		{
			"url": "https://api.github.com/repos/laurent22/joplin/issues/comments/1553880658",
			"html_url": "https://github.com/laurent22/joplin/pull/8213#issuecomment-1553880658",
			"issue_url": "https://api.github.com/repos/laurent22/joplin/issues/8213",
			"id": 1553880658,
			"node_id": "IC_kwDOBLftOs5cnlZS",
			"user": {
				"login": "christopher-o-toole",
				"id": 22433652,
				"node_id": "MDQ6VXNlcjIyNDMzNjUy",
				"avatar_url": "https://avatars.githubusercontent.com/u/22433652?v=4",
				"gravatar_id": "",
				"url": "https://api.github.com/users/christopher-o-toole",
				"html_url": "https://github.com/christopher-o-toole",
				"followers_url": "https://api.github.com/users/christopher-o-toole/followers",
				"following_url": "https://api.github.com/users/christopher-o-toole/following{/other_user}",
				"gists_url": "https://api.github.com/users/christopher-o-toole/gists{/gist_id}",
				"starred_url": "https://api.github.com/users/christopher-o-toole/starred{/owner}{/repo}",
				"subscriptions_url": "https://api.github.com/users/christopher-o-toole/subscriptions",
				"organizations_url": "https://api.github.com/users/christopher-o-toole/orgs",
				"repos_url": "https://api.github.com/users/christopher-o-toole/repos",
				"events_url": "https://api.github.com/users/christopher-o-toole/events{/privacy}",
				"received_events_url": "https://api.github.com/users/christopher-o-toole/received_events",
				"type": "User",
				"user_view_type": "public",
				"site_admin": false
			},
			"created_at": "2023-05-19T01:18:22Z",
			"updated_at": "2023-05-19T01:18:22Z",
			"author_association": "CONTRIBUTOR",
			"body": "Will open this PR again from another branch since some of the commits weren't associated with my GitHub account and thus can't be signed off on using CLA Assistant.",
			"reactions": {
				"url": "https://api.github.com/repos/laurent22/joplin/issues/comments/1553880658/reactions",
				"total_count": 0,
				"+1": 0,
				"-1": 0,
				"laugh": 0,
				"hooray": 0,
				"confused": 0,
				"heart": 0,
				"rocket": 0,
				"eyes": 0
			},
			"performed_via_github_app": null
		}
	]
}