X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=src%2Fviewer.c;h=b9dcbf72759572fa52fd94238793fa50a9462f06;hb=d2fc31c1f5458db55941c531d7270ae70979f864;hp=df66fd58c5b1c4d58d45088f2ec9b79e28fcf942;hpb=51259296e35b24a168e96f0b2fbad5df12d9b6cc;p=smdp.git diff --git a/src/viewer.c b/src/viewer.c index df66fd5..b9dcbf7 100644 --- a/src/viewer.c +++ b/src/viewer.c @@ -612,10 +612,11 @@ void inline_display(WINDOW *window, const char *c, const int colors) { // emphasis or code span can start after new-line or space only // and of cause after another emphasis markup - if(*(i - 1) == ' ' || - ((*(i - 1) == '_' || *(i - 1) == '*') && (*(i - 2) == ' ' || (i - 1) == c)) || - *i == '\\' || - i == c) { + //TODO this condition looks ugly + if(i == c || + *(i - 1) == ' ' || + ((*(i - 1) == '_' || *(i - 1) == '*') && ((i - 1) == c || *(i - 2) == ' ')) || + *i == '\\') { switch(*i) { // enable highlight