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

This commit is contained in:
2026-02-04 20:26:02 +05:00
parent 238f8048e0
commit a1807aa84b
16 changed files with 684 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
package markup;
import java.util.List;
public class OrderedList implements ListItemContent {
private final List<ListItem> items;
public OrderedList(List<ListItem> items) {
this.items = items;
}
@Override
public void toHtml(StringBuilder sb) {
sb.append("<ol>");
for (ListItem item : items) {
item.toHtml(sb);
}
sb.append("</ol>");
}
@Override
public void toTex(StringBuilder sb) {
sb.append("\\begin{enumerate}");
for (ListItem item : items) {
item.toTex(sb);
}
sb.append("\\end{enumerate}");
}
}