mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
remove trailing <br> tag when pasting
https://anki.tenderapp.com/discussions/ankidesktop/33843-anki-2112-adds-br https://anki.tenderapp.com/discussions/ankidesktop/33977-unwanted-automatic-line-break-insertion-after-pasting-into-a-field
This commit is contained in:
parent
1f36a7112f
commit
329c6d365a
1 changed files with 7 additions and 1 deletions
|
@ -342,7 +342,13 @@ function hideDupes() {
|
||||||
|
|
||||||
var pasteHTML = function (html, internal, extendedMode) {
|
var pasteHTML = function (html, internal, extendedMode) {
|
||||||
html = filterHTML(html, internal, extendedMode);
|
html = filterHTML(html, internal, extendedMode);
|
||||||
|
if (html !== "") {
|
||||||
|
// remove trailing <br> in empty field
|
||||||
|
if (currentField && currentField.innerHTML === "<br>") {
|
||||||
|
currentField.innerHTML = "";
|
||||||
|
}
|
||||||
setFormat("inserthtml", html);
|
setFormat("inserthtml", html);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
var filterHTML = function (html, internal, extendedMode) {
|
var filterHTML = function (html, internal, extendedMode) {
|
||||||
|
|
Loading…
Reference in a new issue