Skip to content

Commit

Permalink
Added empty line after tag formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Nov 5, 2015
1 parent eee5639 commit 79a29dc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ var html = `<div>
<i> Some italic </i>
</div>
`
console.log(converter.convert(html))
console.log(converter.convert(html))
4 changes: 2 additions & 2 deletions src/formatters.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var boldRegex = /<(?:b|strong)>([\s\S]*?)<\/\w*>/gim
var italicRegex = /<(?:i|em)>([\s\S]*?)<\/\w*>/gim

/**
* @description executes a regex to replace matched text with
* @description executes a regex to replace matched text with
* selected group with optional pre and postfix
* @method makeRegex
* @param {String} regex [description]
Expand All @@ -37,7 +37,7 @@ function makeRegex (regex, doc, before, after, replaceFn) {
if(replaceFn && typeof(replaceFn) === 'function'){
replaceText = replaceFn(matches)
}
replaceString += replaceText;
replaceString += replaceText + "\n";
replaceString += after || '';
newDoc = newDoc.replace(matches[0],replaceString);
}
Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ module.exports = {
* replacing unncessary html tags
* @type {String}
*/
html = replaceExtras(html);
html = replaceExtras(html);

/**
* looping through registered formatters
Expand All @@ -60,4 +60,4 @@ module.exports = {
use: function (formatter) {
formatters.push(formatter)
}
}
}

0 comments on commit 79a29dc

Please sign in to comment.