pinosaur
/
smdp.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5af57d6
)
make pandoc images behave like links
author
Michael Göhler
<somebody.here@gmx.de>
Fri, 5 Dec 2014 22:13:23 +0000
(23:13 +0100)
committer
Michael Göhler
<somebody.here@gmx.de>
Fri, 5 Dec 2014 22:13:23 +0000
(23:13 +0100)
src/viewer.c
patch
|
blob
|
history
diff --git
a/src/viewer.c
b/src/viewer.c
index
bd533e2
..
38985ae
100644
(file)
--- a/
src/viewer.c
+++ b/
src/viewer.c
@@
-576,7
+576,7
@@
void add_line(WINDOW *window, int y, int x, line_t *line, int max_cols, int colo
}
void inline_display(WINDOW *window, const char *c, const int colors) {
}
void inline_display(WINDOW *window, const char *c, const int colors) {
- const static char *special = "\\*_`["; // list of interpreted chars
+ const static char *special = "\\*_`
!
["; // list of interpreted chars
const char *i = c; // iterator
const char *start_link_name, *start_url;
int length_link_name, url_num;
const char *i = c; // iterator
const char *start_link_name, *start_url;
int length_link_name, url_num;
@@
-637,7
+637,11
@@
void inline_display(WINDOW *window, const char *c, const int colors) {
*i == '\\') {
// url in pandoc style
*i == '\\') {
// url in pandoc style
- if (*i == '[' && strchr(i, ']')) {
+ if ((*i == '[' && strchr(i, ']')) ||
+ (*i == '!' && *(i + 1) == '[' && strchr(i, ']'))) {
+
+ if (*i == '!') i++;
+
if (strchr(i, ']')[1] == '(') {
i++;
if (strchr(i, ']')[1] == '(') {
i++;