mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 22:42:25 -04:00
Fix formatting inside selection not being removed
Regression introduced in #2017 while fixing another bug. Closes #2072
This commit is contained in:
parent
509e0a9811
commit
1a444f30e9
1 changed files with 7 additions and 1 deletions
|
@ -359,7 +359,13 @@ export class Surrounder<T = unknown> {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const isSurrounded = isSurroundedInner(
|
// This is confusing: when nothing is selected, we only
|
||||||
|
// include currently-active buttons, as otherwise inactive
|
||||||
|
// buttons get toggled on. But when something is selected,
|
||||||
|
// we include everything, since we want to remove formatting
|
||||||
|
// that may be in part of the selection, but not at the start/end.
|
||||||
|
|
||||||
|
const isSurrounded = !range.collapsed || isSurroundedInner(
|
||||||
range,
|
range,
|
||||||
base,
|
base,
|
||||||
boolMatcher(format),
|
boolMatcher(format),
|
||||||
|
|
Loading…
Reference in a new issue