Skip to content

Commit

Permalink
#451 Toggle checkboxes in view mode
Browse files Browse the repository at this point in the history
wrong checkbox is associated with action
  • Loading branch information
stefan-niedermann committed Jan 2, 2020
1 parent b142a28 commit 94903e6
Showing 1 changed file with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,21 @@ public void onActivityCreated(@Nullable Bundle savedInstanceState) {
try {
String[] lines = TextUtils.split(note.getContent(), "\\r?\\n");
/*
* Workaround for multiple bugs:
* Workaround for RxMarkdown-bug:
* 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
*/
for(int i = 0; i < lines.length; i++) {
if(lines[i].startsWith("```")) {
lineNumber++;
}
if(i == lineNumber) {
break;
}
}

/*
* Workaround for multiple RxMarkdown-bugs:
* When (un)checking a checkbox which is in the last line, every time it gets toggled, the last character of the line gets lost.
* When (un)checking a checkbox, every markdown gets stripped in the given line argument
*/
Expand Down

0 comments on commit 94903e6

Please sign in to comment.