Skip to content

Commit 963176a

Browse files
Merge pull request #13 from razroo/ZETA-8704-update-readme-html-adf
Zeta 8704 update readme to include jira markdown to html + markdown logic
2 parents a9f3fdd + ada923b commit 963176a

File tree

3 files changed

+51
-5
lines changed

3 files changed

+51
-5
lines changed

README.md

Lines changed: 48 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
# Html To ADF
2-
Used to convert Atlassian Document Format from ADF to html and also from
3-
html to adf
2+
Used to convert from Atlassian Document Format(ADF) and also from
3+
html to ADF. In addition, allows to convert from Jira Markdown to
4+
regular markdown.
45

56
# How to install
67
```
78
npm install @razroo/html-to-adf --save
89
```
910

10-
## Two main functions
11+
## HTML to ADF + ADF to HTML
1112

1213
### convertHtmlToADF
1314

@@ -82,4 +83,48 @@ it('should convert a simple paragraph with bold', () => {
8283
const expected = `<p>test <b>this</b></p>`;
8384
expect(result).toEqual(expected);
8485
});
86+
```
87+
88+
## Convert Jira Markdown to Markdown or HTML
89+
90+
### Convert Jira Markdown to Markdown
91+
```ts
92+
it('should convert jira markdown to regular markdown', () => {
93+
const jiraMarkdown = "*Feature*: Convert Jira ticket ADF description to HTML\n\nScenario: User converts Jira ticket ADF to HTML\nGiven that I have a Jira ticket ADF description\nWhen I initiate the conversion process\n And use the importJiraTicket function\nThen the ADF description is successfully converted to HTML\n\nNotes: \n\n# Will use the function here: [https://github.com/razroo/html-to-adf?tab=readme-ov-file#convertadftohtml|https://github.com/razroo/html-to-adf?tab=readme-ov-file#convertadftohtml|smart-link] \n# Will be within the importJiraTickets function";
94+
const result = convertJiraMarkdownToRegularMarkdown(jiraMarkdown);
95+
const expected = `**Feature**: Convert Jira ticket ADF description to HTML
96+
97+
Scenario: User converts Jira ticket ADF to HTML
98+
Given that I have a Jira ticket ADF description
99+
When I initiate the conversion process
100+
And use the importJiraTicket function
101+
Then the ADF description is successfully converted to HTML
102+
103+
Notes:
104+
105+
1. Will use the function here: [https://github.com/razroo/html-to-adf?tab=readme-ov-file#convertadftohtml](https://github.com/razroo/html-to-adf?tab=readme-ov-file#convertadftohtml)
106+
1. Will be within the importJiraTickets function`;
107+
expect(result).toEqual(expected);
108+
});
109+
```
110+
111+
### Convert Jira Markdown to HTML
112+
```ts
113+
it('should convert jira markdown to html', async() => {
114+
const jiraMarkdown = "*Feature*: Convert Jira ticket ADF description to HTML\n\nScenario: User converts Jira ticket ADF to HTML\nGiven that I have a Jira ticket ADF description\nWhen I initiate the conversion process\n And use the importJiraTicket function\nThen the ADF description is successfully converted to HTML\n\nNotes: \n\n# Will use the function here: [https://github.com/razroo/html-to-adf?tab=readme-ov-file#convertadftohtml|https://github.com/razroo/html-to-adf?tab=readme-ov-file#convertadftohtml|smart-link] \n# Will be within the importJiraTickets function";
115+
const result = await convertJiraMarkdownToHtml(jiraMarkdown);
116+
const expected = `<p><strong>Feature</strong>: Convert Jira ticket ADF description to HTML</p>
117+
<p>Scenario: User converts Jira ticket ADF to HTML
118+
Given that I have a Jira ticket ADF description
119+
When I initiate the conversion process
120+
And use the importJiraTicket function
121+
Then the ADF description is successfully converted to HTML</p>
122+
<p>Notes: </p>
123+
<ol>
124+
<li>Will use the function here: <a href="https://github.com/razroo/html-to-adf?tab=readme-ov-file#convertadftohtml">https://github.com/razroo/html-to-adf?tab=readme-ov-file#convertadftohtml</a> </li>
125+
<li>Will be within the importJiraTickets function</li>
126+
</ol>
127+
`;
128+
expect(result).toEqual(expected);
129+
});
85130
```

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@razroo/html-to-adf",
3-
"version": "1.1.0",
3+
"version": "1.1.1",
44
"description": "HtmlToAdf",
55
"main": "./lib/cjs/index.js",
66
"types": "./lib/cjs/types/index.d.ts",

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
export {convertHtmlToADF} from './html-to-adf';
2-
export {convertADFToHtml} from './adf-to-html';
2+
export {convertADFToHtml} from './adf-to-html';
3+
export {convertJiraMarkdownToRegularMarkdown, convertJiraMarkdownToHtml} from './jm-to-markdown';

0 commit comments

Comments
 (0)