mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-30 14:57:59 +01:00
fix extra markup surrounding empty lines in textile toolbar
This commit is contained in:
parent
58d8d24812
commit
fad734b50c
1 changed files with 1 additions and 6 deletions
|
@ -90,12 +90,7 @@ function wrapSelection(textarea, options) {
|
||||||
scrollTop = textarea.scrollTop,
|
scrollTop = textarea.scrollTop,
|
||||||
emptyText = text === '';
|
emptyText = text === '';
|
||||||
|
|
||||||
let newText = text;
|
const newText = text;
|
||||||
if (!emptyText && prefix[0] !== '[') {
|
|
||||||
newText = text.replace(/(\n{2,})/g, match => {
|
|
||||||
return suffix + match + prefix;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (type === 'inline' && newText.includes('\n')) {
|
if (type === 'inline' && newText.includes('\n')) {
|
||||||
textarea.value = `${beforeSelection}[${prefix}${newText}${suffix}]${afterSelection}`;
|
textarea.value = `${beforeSelection}[${prefix}${newText}${suffix}]${afterSelection}`;
|
||||||
|
|
Loading…
Reference in a new issue