editor: Insert separator on a new line

This commit is contained in:
Eragon 2022-11-28 12:20:26 +01:00
parent 28935b2ae8
commit cd84ccf4e6
Signed by untrusted user: Eragon
GPG Key ID: 087126EBFC725006
2 changed files with 4 additions and 2 deletions

View File

@ -59,7 +59,7 @@ function editor_insert_around(event)
ta.selectionEnd = end;
}
else {
ta.selectionStart = ta.selectionEnd =start + before.length;
ta.selectionStart = ta.selectionEnd = start + before.length;
}
}

View File

@ -86,7 +86,9 @@
<path d="M3 3v18h18V3H3zm8 16H5v-6h6v6zm0-8H5V5h6v6zm8 8h-6v-6h6v6zm0-8h-6V5h6v6z"/>
</svg>
</button>
<button type="button" onclick="editor_btn_type()" title="Séparateur">
<!-- I need to find a way to replace this LF with an \n -->
<button type="button" onclick="editor_insert_around(event)" data-after="
---" title="Séparateur">
<svg viewBox="0 0 24 24">
<rect fill-rule="evenodd" height="2" width="16" x="4" y="11"/>
</svg>