Skip to content

Commit

Permalink
fix extra markup surrounding empty lines in textile toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
liamwhite committed Feb 25, 2021
1 parent 58d8d24 commit fad734b
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions assets/js/textiletoolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,7 @@ function wrapSelection(textarea, options) {
scrollTop = textarea.scrollTop,
emptyText = text === '';

let newText = text;
if (!emptyText && prefix[0] !== '[') {
newText = text.replace(/(\n{2,})/g, match => {
return suffix + match + prefix;
});
}
const newText = text;

if (type === 'inline' && newText.includes('\n')) {
textarea.value = `${beforeSelection}[${prefix}${newText}${suffix}]${afterSelection}`;
Expand Down

0 comments on commit fad734b

Please sign in to comment.