-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a575937
commit d21b130
Showing
5 changed files
with
114 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
...arser-doxia-module/src/test/java/org/asciidoctor/maven/site/ast/processors/test/Html.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package org.asciidoctor.maven.site.ast.processors.test; | ||
|
||
public class Html { | ||
|
||
public static final String LIST_STYLE_TYPE_DECIMAL = "list-style-type: decimal"; | ||
|
||
public static String strong(String text) { | ||
return htmlElement("strong", text); | ||
} | ||
|
||
public static String italics(String text) { | ||
return htmlElement("em", text); | ||
} | ||
|
||
public static String monospace(String text) { | ||
return htmlElement("code", text); | ||
} | ||
|
||
public static String ul(String... elements) { | ||
return htmlElement("ul", String.join("", elements)); | ||
} | ||
|
||
public static String ol(String style, String... elements) { | ||
return htmlElement("ol", style, String.join("", elements)); | ||
} | ||
|
||
public static String li(String text) { | ||
return htmlElement("li", text); | ||
} | ||
|
||
public static String dt(String text) { | ||
return htmlElement("dt", text); | ||
} | ||
|
||
public static String dd(String text) { | ||
return htmlElement("dd", text); | ||
} | ||
|
||
static String htmlElement(String element, String text) { | ||
return htmlElement(element, null, text); | ||
} | ||
|
||
static String htmlElement(String element, String style, String text) { | ||
if (style == null) { | ||
return String.format("<%1$s>%2$s</%1$s>", element, text).trim(); | ||
} | ||
return String.format("<%1$s style=\"%3$s\">%2$s</%1$s>", element, text, style).trim(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters