Skip to content

Commit

Permalink
Minor bigfixes
Browse files Browse the repository at this point in the history
Prefer const to var

Fis whitespace check on strikethrough

Use 2 spaces for indenting

Comment out citation test

Standardize formatting

Use let rather than const where appropriate

Fix markdown to jira strikethrough

Do not transform intra-word underscores

Do not transform intra-word asterisks

Remove citation from example blob to fix integration test

Prevent intra-word formatting in the markdown to jira direction

Handle multpile sections of bold and italic in a string

Handle multiple codeblocks in the jira to markdown direction

Fix tests to expect that formating should not be applied within codeblocks and {noformat} blocks

Handle edge cases for bold and italic formatting

Use nested describe blocks to make tests clearer

Add an underscore in front of unused arguments

Improve emphasis formatting from markdown to Jira

Add unit tests for urls and emails

Get rid of Makefile

Prevent further formatting being performed within codeblocks and noformat blocks

Update package.json

Add FAQ section to README

Add unit test for md2jira multiple codeblocks

Remove unnecessary comment

Make J2M a 'Class' for readability

Remove stale code

Require a specific direction when transforming MD

Update references
  • Loading branch information
karimatthews committed Jun 16, 2019
1 parent 2891df7 commit 44f0bb9
Show file tree
Hide file tree
Showing 9 changed files with 860 additions and 361 deletions.
5 changes: 0 additions & 5 deletions Makefile

This file was deleted.

30 changes: 22 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
# jira2md

## JIRA to MarkDown text format converter
Convert from JIRA text formatting to GitHub Flavored MarkDown and back again. Also allows for both to be converted to HTML.

Convert from JIRA text formatting to GitHub Flavored Markdown and back again. Also allows for both to be converted to HTML.

## Credits
This module was heavily inspired by the J2M project by Fokke Zandbergen (http://j2m.fokkezb.nl/). Major credit to Fokke (and other contributors) for establishing a lot of the fundamental RexExp patterns for this module to work.

This module was heavily inspired by the [J2M project by Fokke Zandbergen](http://j2m.fokkezb.nl/).
Major credit to Fokke (and other contributors) for establishing a lot of the fundamental RexExp patterns for this module to work.

## Installation
```

```sh
npm install jira2md
```

## Supported Conversions

NOTE: All conversion work bi-directionally (from jira to markdown and back again).

* Headers (H1-H6)
Expand All @@ -34,14 +39,13 @@ NOTE: All conversion work bi-directionally (from jira to markdown and back again
* Tables (thanks to erykwarren)
* Panels (thanks to erykwarren)


## How to Use

### Markdown String

We'll refer to this as the `md` variable in the examples below.

```
```md
**Some bold things**
*Some italic stuff*
## H2
Expand All @@ -52,7 +56,7 @@ We'll refer to this as the `md` variable in the examples below.

We'll refer to this as the `jira` variable in the examples below.

```
```jira
*Some bold things**
_Some italic stuff_
h2. H2
Expand All @@ -63,9 +67,9 @@ h2. H2

```javascript
// Include the module
var j2m = require('jira2md');
var j2m = require('jira2md'); or import jira2md from 'jira2md';

// If converting from Mardown to Jira Wiki Syntax:
// If converting from Markdown to Jira Wiki Syntax:
var jira = j2m.to_jira(md);

// If converting from Jira Wiki Syntax to Markdown:
Expand All @@ -77,3 +81,13 @@ var html = j2m.md_to_html(md);
// If converting from JIRA Wiki Syntax to HTML:
var html = j2m.jira_to_html(jira);
```

### Running tests

You can run `yarn test` or `npm test`

### FAQ

#### Q. Why doesn't this module support conversion of inline markdown?

A. Jira doesn't support inline code formatting, so the best we can do is to keep the backticks in place.
Loading

0 comments on commit 44f0bb9

Please sign in to comment.