File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3232#define NO_SKIP -1
3333#define SET_SKIP_N (_c ,_n ) do {toskip = _c; nskip = _n;} while(0)
3434#define SET_SKIP (_c ) SET_SKIP_N(_c, 1)
35+ #define SKIP_UNTIL (_c ) do{i++;} while(PEEK == _c)
3536#define RESET_SKIP () do {toskip = NO_SKIP; nskip = 1;} while(0)
3637
3738#if GENERATE_SQLITE_DATABASE
@@ -245,7 +246,6 @@ static char *process_md (const char *input, size_t *len) {
245246
246247 case '[' :
247248 case ']' :
248- case '\t' :
249249 case '*' : {
250250 // skip character
251251 continue ;
@@ -262,6 +262,24 @@ static char *process_md (const char *input, size_t *len) {
262262 if (json_mode ) buffer [j ++ ] = '\\' ;
263263 break ;
264264 }
265+
266+ case '\t' : {
267+ // replace tabulations with spaces
268+ if (json_mode ){
269+ if (PEEK == '\t' ){
270+ continue ;
271+ } else {
272+ c = ' ' ;
273+ }
274+ }
275+ break ;
276+ }
277+
278+ case ' ' : {
279+ // remove multiple spaces
280+ if (PEEK == ' ' ) SKIP_UNTIL (' ' );
281+ break ;
282+ }
265283
266284 case 'i' : {
267285 if (strip_jsx == false) break ;
You can’t perform that action at this time.
0 commit comments