Skip to content

Commit

Permalink
Fix for Issue laurent22#430
Browse files Browse the repository at this point in the history
  • Loading branch information
solariz committed Apr 21, 2018
1 parent 4e3b8a0 commit 577bef5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ReactNativeClient/lib/MdToHtml.js
Original file line number Diff line number Diff line change
Expand Up @@ -420,8 +420,8 @@ class MdToHtml {

if (HORRIBLE_HACK) {
let counter = -1;
while (body.indexOf('- [ ]') >= 0 || body.indexOf('- [X]') >= 0) {
body = body.replace(/- \[(X| )\]/, function(v, p1) {
while (body.indexOf('- [ ]') >= 0 || body.indexOf('- [X]') >= 0 || body.indexOf('- [x]') >= 0) {
body = body.replace(/- \[(X| |x)\]/, function(v, p1) {
let s = p1 == ' ' ? 'NOTICK' : 'TICK';
counter++;
return '- mJOPmCHECKBOXm' + s + 'm' + counter + 'm';
Expand Down Expand Up @@ -577,10 +577,10 @@ class MdToHtml {

toggleTickAt(body, index) {
let counter = -1;
while (body.indexOf('- [ ]') >= 0 || body.indexOf('- [X]') >= 0) {
while (body.indexOf('- [ ]') >= 0 || body.indexOf('- [X]') >= 0 || body.indexOf('- [x]') >= 0) {
counter++;

body = body.replace(/- \[(X| )\]/, function(v, p1) {
body = body.replace(/- \[(X| |x)\]/, function(v, p1) {
let s = p1 == ' ' ? 'NOTICK' : 'TICK';
if (index == counter) {
s = s == 'NOTICK' ? 'TICK' : 'NOTICK';
Expand Down

0 comments on commit 577bef5

Please sign in to comment.