I’m trying to use the Atlaskit/editor-core react modules to support editing the Jira Description field and oddly it seems the only well supported transformers within the react/atlaskit bundles are those that transform to and from HTML and not the markup which Jira is already using. Both the Markdown and Wiki transformers show an error message of something like “Uncaught (in promise) Error: This is not implemented yet
at MarkdownTransformer.encode (index.js:138)
at eval (index.js:82)”
Neither actually ENCODE the editor output… so how in the world are we supposed to use the editor to save into a description field. I feel like i’m missing something horribly obvious. Thanks!
Did you figured it out? or any updates as to the status of this?
As a side note I used the following for my implementation which worked pretty well for me. I got really excited when i ran into atlaskit only to be disappointed. The one problem I have with the current implementation I have is I want to be able to use text color which is supported by Atlassian but not markdown.
Further followup for anyone else looking at this. The WikiMarkupTransformer seems to work. The main problem is that it doesn’t understand Jira’s description data out of the box which is problematic but it’s really simple to get it to work after seeing what it was doing.
.replace(/\r/gi,'').replace(/\n /gi, '\n')
Basically Jira stores \r\n for every new line (in particular with bullet regarding the space) the Wiki transformer gets confused on that. Once I removed the extra space at the end of the line it worked. I think that was the important piece more so than the \r i just needed to be sure in case \n\r came around. Next i need to try actually saving this edited description to Jira for the final test.
and final post here as this serves anyone else who runs into this. Important piece to enable saving is to use the transformer to turn the doc back into wiki markup text. Full example below for anyone looking. May not work as i tried to simplify it as much as possible from my use case.
This solution worked for me however still I have problem with mention data not coming back properly in ReactRenderer… I try different option but no success.
ADFEncoder generating proper mention object with text attribute blank. so it looks when we transform editor data to wiki it generate mention data in this format [~13]… but at time of render back adfEncoder not able to generate properly.
const adfEncoder = new ADFEncoder(
schema => new WikiMarkupTransformer(schema)
);
const doc = adfEncoder.encode(document);