Skip to content
This repository has been archived by the owner on Jul 27, 2020. It is now read-only.

Support Jira numbered lists conversion to Github numbered lists #25

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/J2M.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
return to + content + to;
});

input = input.replace(/([\t| ]*)(# )([-\w]*)?/g, '$11. $3');
input = input.replace(/\{\{([^}]+)\}\}/g, '`$1`');
input = input.replace(/\?\?((?:.[^?]|[^?].)+)\?\?/g, '<cite>$1</cite>');
input = input.replace(/\+([^+]*)\+/g, '<ins>$1</ins>');
Expand Down Expand Up @@ -78,14 +79,14 @@
var START = 'J2MBLOCKPLACEHOLDER';
var replacementsList = [];
var counter = 0;

input = input.replace(/`{3,}(\w+)?((?:\n|.)+?)`{3,}/g, function(match, synt, content) {
var code = '{code';

if (synt) {
code += ':' + synt;
}

code += '}' + content + '{code}';
var key = START + counter++ + '%%';
replacementsList.push({key: key, value: code});
Expand Down