Skip to content

Commit

Permalink
Add mapping logic for table elements
Browse files Browse the repository at this point in the history
  • Loading branch information
morpheus-87 committed Aug 31, 2023
1 parent d460a41 commit 525eefa
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
import de.digitalcollections.model.text.contentblock.ContentBlockNode;
import de.digitalcollections.model.text.contentblock.ListItem;
import de.digitalcollections.model.text.contentblock.Mark;
import de.digitalcollections.model.text.contentblock.Table;
import de.digitalcollections.model.text.contentblock.TableCell;
import de.digitalcollections.model.text.contentblock.TableHeader;
import de.digitalcollections.model.text.contentblock.TableRow;
import de.digitalcollections.model.text.contentblock.Text;
import java.util.List;
import org.jsoup.Jsoup;
Expand Down Expand Up @@ -38,6 +42,14 @@ public static ContentBlock getContentBlock(Node node) {
contentBlock = new BulletList();
} else if ("li".equalsIgnoreCase(tagName)) {
contentBlock = new ListItem();
} else if ("table".equalsIgnoreCase(tagName)) {
contentBlock = new Table();
} else if ("tr".equalsIgnoreCase(tagName)) {
contentBlock = new TableRow();
} else if ("th".equalsIgnoreCase(tagName)) {
contentBlock = new TableHeader();
} else if ("th".equalsIgnoreCase(tagName)) {
contentBlock = new TableCell();
} else if ("a".equalsIgnoreCase(tagName)) {
// TODO only simple plain text links are supported until now; dive into nodes of a-element
// for further linked content
Expand Down

0 comments on commit 525eefa

Please sign in to comment.