- private void generateComicHtml(StringBuilder html, Comic comic) {
- html.append("<div>").append("<h1>").append(StringEscapeUtils.escapeHtml4(comic.title())).append("</h1>\n");
- for (Strip strip : comic) {
- html.append("<div><img src=\"").append(StringEscapeUtils.escapeHtml4(strip.imageUrl()));
- html.append("\" alt=\"").append(StringEscapeUtils.escapeHtml4(strip.comment()));
- html.append("\" title=\"").append(StringEscapeUtils.escapeHtml4(strip.comment()));
- html.append("\" /></div>\n");
- html.append("<div>").append(StringEscapeUtils.escapeHtml4(strip.comment())).append("</div>\n");
- }
- html.append("</div>");
+ private void generateComicHtml(FlowContent flowContent, Comic comic) {
+ div(flowContent, null, wrapper(div -> {
+ h1(div, null, wrapper(h1 -> h1.text(comic.title())));
+ for (Strip strip : comic) {
+ div(div, null, wrapper(imageDiv -> {
+ img(imageDiv, strip.comment(), strip.imageUrl(), null, null, wrapper(img ->
+ img.getAttributes().put("title", strip.comment())
+ ));
+ }));
+ div(div, null, wrapper(commentDiv -> commentDiv.text(strip.comment())));
+ }
+ }));