Parse Issue description as HTML

Hi there,

I’m using jira API to get the data of the jira issue and I’m getting the response as below.

{panel:title=Summary:|bgColor:#E0EFFF}
This is the jira issue panel text
{panel}

But I want to render it as HTML so I need to parse it. Is there any existing package provided by jira for parsing the response to HTML?

Looks like wiki format. You need to transform it to ADF format and then you can render it with Atlaskit by Atlassian

import { defaultSchema } from "@atlaskit/adf-schema/schema-default";
import {
  JSONDocNode,
  JSONTransformer,
} from "@atlaskit/editor-json-transformer";
import { WikiMarkupTransformer } from "@atlaskit/editor-wikimarkup-transformer";
import { ReactRenderer } from "@atlaskit/renderer";

const jsonTransformer = new JSONTransformer();
const wikiTransformer = new WikiMarkupTransformer(defaultSchema);

const node = jsonTransformer.encode(wikiTransformer.parse("{panel:title=Summary:|bgColor:#E0EFFF}"))


const C = () => <ReactRenderer document={node}/>

Or you can try email renderer instead of react Atlaskit by Atlassian.

Be careful, the weight of “@atlaskit/renderer” is more then weight of sun

1 Like

Hi Alexandr,
When you say the atlaskit/renderer is heavy, you mean the size of the package, or the renderer performance?

Hi, I mean the size. I did not measure the performance