Skip to content

Commit fceb844

Browse files
committed
Dynamic programming for text justification
1 parent 2b6b982 commit fceb844

File tree

5 files changed

+132
-587
lines changed

5 files changed

+132
-587
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ include config.mk
1313
md2mime : md2mime.c $(OBJS)
1414
$(CC) $(CFLAGS) $(POSIX) $(LDFLAGS) -o $@ md2mime.c $(OBJS) $(LDLIBS)
1515

16-
wrap.o : wrap.c wrap.h vendor/queue.h
16+
wrap.o : wrap.c wrap.h
1717

1818
smtp.o : smtp.c smtp.h
1919

md2mime.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ struct doc_link *parse_link(cmark_iter *iter)
7171
if (ev_type == CMARK_EVENT_EXIT && type == CMARK_NODE_LINK)
7272
break;
7373
if (ev_type == CMARK_EVENT_ENTER && type == CMARK_NODE_TEXT)
74-
wordlist_append(link->caption, cmark_node_get_literal(cur));
74+
wordlist_segment(link->caption, cmark_node_get_literal(cur));
7575
}
7676
return link;
7777
}
@@ -99,16 +99,16 @@ size_t render_inner_text(cmark_iter *iter, char *prefix, char *overhang, bool fl
9999
if (link)
100100
{
101101
wordlist_concat(ws, link->caption);
102-
wordlist_append(ws, link->pretty_id);
102+
wordlist_segment(ws, link->pretty_id);
103103
}
104104
else
105-
wordlist_append(ws, "[could not parse link]");
105+
wordlist_segment(ws, "[could not parse link]");
106106
}
107107
else
108108
{
109109
const char *content = cmark_node_get_literal(cur);
110110
if (content)
111-
wordlist_append(ws, content);
111+
wordlist_segment(ws, content);
112112
}
113113
}
114114
}

0 commit comments

Comments
 (0)