diff --git a/build.gradle.kts b/build.gradle.kts index 10e7075..50b6165 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -21,7 +21,7 @@ plugins { } group = "dev.dediamondpro" -version = "1.1.0+localtest15" +version = "1.1.0" repositories { mavenCentral() diff --git a/src/main/java/dev/dediamondpro/minemark/elements/impl/list/ListElement.java b/src/main/java/dev/dediamondpro/minemark/elements/impl/list/ListElement.java index 95af644..e20b657 100644 --- a/src/main/java/dev/dediamondpro/minemark/elements/impl/list/ListElement.java +++ b/src/main/java/dev/dediamondpro/minemark/elements/impl/list/ListElement.java @@ -34,11 +34,13 @@ public abstract class ListElement extends ChildMovingElement public ListElement(@NotNull S style, @NotNull LayoutStyle layoutStyle, @Nullable Element parent, @NotNull String qName, @Nullable Attributes attributes) { super(style, layoutStyle, parent, qName, attributes); if (!(parent instanceof ListHolderElement)) { - throw new IllegalArgumentException("List element has no surrounding list holder!"); + listType = ListHolderElement.ListType.UNORDERED; + elementIndex = 0; + } else { + ListHolderElement holder = (ListHolderElement) parent; + listType = holder.getListType(); + elementIndex = holder.getChildren().indexOf(this); } - ListHolderElement holder = (ListHolderElement) parent; - listType = holder.getListType(); - elementIndex = holder.getChildren().indexOf(this); }