Closed agatheblues closed 1 year ago
This’ll require an update to https://github.com/bitcrowd/mdast-util-from-adf, adding support for this node type (as suggested in the error message). I didn’t know expand nodes were a thing in Jira tickets before. 💡
I am still on a bike trip, away from my computer, so I won’t be fixing this before I get back home in about 2 weeks maybe. I am hoping the pointer might help you out though. ❤️
Feel free to @mention or otherwise ping me if I can be of further assistance in the meantime. 🏓
Kind greetings 👋
Here's an example document you can throw at Atlassian's document viewer:
{
"type": "doc",
"version": 1,
"content": [
{
"type": "expand",
"attrs": {
"title": "Summary"
},
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Expanded content…"
}
]
}
]
}
]
}
I derived the structure and required attributes from the current (v24.0.0) ADF JSON schema.
The Atlassian viewer renders this with a toggle <button>
expanding/collapsing an associated <div>
. A more semantically sound approach might convert this to <details>
and <summary>
nodes which GitHub can render as well.
Example:
<details>
<summary>Summary</summary>
Expanded content…
</details>
Rendered example:
I'll take a look at updating the mdast-util-from-adf package. ✌️
Seems like the package where mdast-util-from-adf
gets its definitions from also has recent updates: https://www.npmjs.com/package/@atlaskit/adf-schema
I cannot reach their bitbucket repository though 🙈
Seems like the package where
mdast-util-from-adf
gets its definitions from also has recent updates: https://www.npmjs.com/package/@atlaskit/adf-schemaI cannot reach their bitbucket repository though 🙈
You can browse the source (including a changelog) here: https://unpkg.com/browse/@atlaskit/adf-schema@24.0.1/
(A rather long) PS: Sorry, I did not find enough time and motivation yet to update mdast-util-from-adf
. I've investigated though and after jotting down my findings I am thinking we might just not represent expand
nodes in the conversion output. Any expand
's child nodes will still be converted, but the expand
itself would not have any counterpart in the MDAST tree. This would fix this issue here and could be iterated on later if ever needed. Happy about comments & thoughts. ❤️
No worries @pmeinhardt 🤗
As the adapter is also broken for Jira server instances (see #349), my current plan of attack would be to release a "fix" version which does not include ADF to .md
and then release a "fix all Jiras" later. Asking users to go back to previous versions is a bit too much with browser extensions 😉
💥 The extension is broken when the jira ticket description contains "expand" blocks:
Tickety-Tick revision: 8714b5142d40c0c2d5f2a51bf867f2702463ed25
Happened on Firefox 103.0