Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 45ce9019 authored by Stefan Niedermann's avatar Stefan Niedermann
Browse files

- 🐞 Fix toggling checkboxes when note contains codefences with empty lines

parent 27b982cb
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -117,8 +117,13 @@ public class NotePreviewFragment extends SearchableBaseNoteFragment implements O
                                         * When (un)checking a checkbox in a note which contains code-blocks, the "`"-characters get stripped out in the TextView and therefore the given lineNumber is wrong
                                         * Find number of lines starting with ``` before lineNumber
                                         */
                                        boolean inCodefence = false;
                                        for (int i = 0; i < lines.length; i++) {
                                            if (lines[i].startsWith("```")) {
                                                inCodefence = !inCodefence;
                                                lineNumber++;
                                            }
                                            if (inCodefence && TextUtils.isEmpty(lines[i])) {
                                                lineNumber++;
                                            }
                                            if (i == lineNumber) {
+1 −0
Original line number Diff line number Diff line
- 🐞 Fix toggling checkboxes when note contains codefences with empty lines
 No newline at end of file