Skip to content

Commit

Permalink
remove attributeUndefined option in favour of direct atrtibute usage (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
abelsromero committed Jun 18, 2020
1 parent db27b4d commit 8123539
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 30 deletions.
28 changes: 0 additions & 28 deletions src/main/java/org/asciidoctor/maven/AsciidoctorMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,6 @@ public class AsciidoctorMojo extends AbstractMojo {
@Parameter(property = AsciidoctorMaven.PREFIX + "embedAssets")
protected boolean embedAssets = false;

@Parameter(property = AsciidoctorMaven.PREFIX + "attributeMissing")
protected String attributeMissing = "skip";

@Parameter(property = AsciidoctorMaven.PREFIX + "attributeUndefined")
protected String attributeUndefined = "drop-line";

// List of resources to copy to the output directory (e.g., images, css). By default everything is copied
@Parameter(property = AsciidoctorMaven.PREFIX + "sources")
protected List<Resource> resources;
Expand Down Expand Up @@ -528,12 +522,6 @@ protected void setAttributesOnBuilder(AttributesBuilder attributesBuilder) throw
attributesBuilder.dataUri(true);
}

if ("drop".equals(attributeUndefined) || "drop-line".equals(attributeUndefined)) {
attributesBuilder.attributeUndefined(attributeUndefined);
} else {
throw new MojoExecutionException(attributeUndefined + " is not valid. Must be one of 'drop' or 'drop-line'");
}

AsciidoctorHelper.addAttributes(attributes, attributesBuilder);

if (!attributesChain.isEmpty()) {
Expand Down Expand Up @@ -662,22 +650,6 @@ public void setEmbedAssets(boolean embedAssets) {
this.embedAssets = embedAssets;
}

public String getAttributeMissing() {
return attributeMissing;
}

public void setAttributeMissing(String attributeMissing) {
this.attributeMissing = attributeMissing;
}

public String getAttributeUndefined() {
return attributeUndefined;
}

public void setAttributeUndefined(String attributeUndefined) {
this.attributeUndefined = attributeUndefined;
}

public File getProjectDirectory() {
return projectDirectory;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ class AsciidoctorMojoTest extends Specification {
mojo.sourceDirectory = srcDir
mojo.sourceDocumentName = 'attribute-undefined.adoc'
mojo.backend = 'html'
mojo.attributeUndefined = 'drop'
mojo.attributes = ['attribute-undefined':'drop']
mojo.execute()
then:
File sampleOutput = new File(outputDir, 'attribute-undefined.html')
Expand All @@ -429,7 +429,7 @@ class AsciidoctorMojoTest extends Specification {
mojo.sourceDirectory = srcDir
mojo.sourceDocumentName = 'attribute-undefined.adoc'
mojo.backend = 'html'
mojo.attributeMissing = 'drop-line'
mojo.attributes = ['attribute-undefined':'drop-line']
mojo.execute()
then:
File sampleOutput = new File(outputDir, 'attribute-undefined.html')
Expand Down

0 comments on commit 8123539

Please sign in to comment.