pinosaur
/
smdp.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
removed duplicated expression
[smdp.git]
/
src
/
viewer.c
diff --git
a/src/viewer.c
b/src/viewer.c
index
df66fd5
..
b9dcbf7
100644
(file)
--- 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
// 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
switch(*i) {
// enable highlight