add solutions for hw7 (markup) and tests
Some checks failed
Fast Reverse Tests / test (push) Failing after 17s
Markup Tests / test (push) Failing after 13s
Reverse Tests / test (push) Failing after 13s
Sum Tests / test (push) Failing after 13s
Word Stat Tests / test (push) Failing after 13s
Word Stat++ Tests / test (push) Failing after 13s
Some checks failed
Fast Reverse Tests / test (push) Failing after 17s
Markup Tests / test (push) Failing after 13s
Reverse Tests / test (push) Failing after 13s
Sum Tests / test (push) Failing after 13s
Word Stat Tests / test (push) Failing after 13s
Word Stat++ Tests / test (push) Failing after 13s
This commit is contained in:
26
java/markup/ListItem.java
Normal file
26
java/markup/ListItem.java
Normal file
@@ -0,0 +1,26 @@
|
||||
package markup;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ListItem {
|
||||
private final List<ListItemContent> elements;
|
||||
|
||||
public ListItem(List<ListItemContent> elements) {
|
||||
this.elements = elements;
|
||||
}
|
||||
|
||||
public void toHtml(StringBuilder sb) {
|
||||
sb.append("<li>");
|
||||
for (ListItemContent element : elements) {
|
||||
element.toHtml(sb);
|
||||
}
|
||||
sb.append("</li>");
|
||||
}
|
||||
|
||||
public void toTex(StringBuilder sb) {
|
||||
sb.append("\\item ");
|
||||
for (ListItemContent element : elements) {
|
||||
element.toTex(sb);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user