mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-23 17:06:16 -04:00
Lgtm bugfixes (#4838)
* code tidy up: always evaluates * tidy up: is always true * tidy up: remove unused code * always true/false variables * unused variable * tidy up: remove unused code in caretPosition.js * for squash: Revert "tidy up: remove unused code in caretPosition.js" The `if` condition was previously always true, so the body should be preserved. If the body is preserved, other logic can be deleted. I opened PR #4845 to clean it all up. This reverts commit75b03e5a7d
. * for squash: simplify * for squash: Explain that the getter is used for its side effects It's very weird to call a getter without using its return value. Add a comment explaining why this is done so that the reader doesn't get confused. * for squash: Revert "tidy up: remove unused code" The exception test was the purpose of the code. This reverts commit85153b1676
. * for squash: Log the tsort results Co-authored-by: Richard Hansen <rhansen@rhansen.org>
This commit is contained in:
parent
de186fbe36
commit
ce83181ac3
8 changed files with 9 additions and 10 deletions
|
@ -314,7 +314,7 @@ const getHTMLFromAtext = async (pad, atext, authorColors) => {
|
|||
await hooks.aCallAll('getLineHTMLForExport', context);
|
||||
// To create list parent elements
|
||||
if ((!prevLine || prevLine.listLevel !== line.listLevel) ||
|
||||
(prevLine && line.listTypeName !== prevLine.listTypeName)) {
|
||||
(line.listTypeName !== prevLine.listTypeName)) {
|
||||
const exists = _.find(openLists, (item) => (
|
||||
item.level === line.listLevel && item.type === line.listTypeName)
|
||||
);
|
||||
|
@ -414,7 +414,7 @@ const getHTMLFromAtext = async (pad, atext, authorColors) => {
|
|||
if ((!nextLine ||
|
||||
!nextLine.listLevel ||
|
||||
nextLine.listLevel < line.listLevel) ||
|
||||
(nextLine && line.listTypeName !== nextLine.listTypeName)) {
|
||||
(line.listTypeName !== nextLine.listTypeName)) {
|
||||
let nextLevel = 0;
|
||||
if (nextLine && nextLine.listLevel) {
|
||||
nextLevel = nextLine.listLevel;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue