[
https://issues.apache.org/jira/browse/DOXIA-731?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17825635#comment-17825635
]
ASF GitHub Bot commented on DOXIA-731:
--------------------------------------
michael-o commented on code in PR #202:
URL: https://github.com/apache/maven-doxia/pull/202#discussion_r1521286075
##########
doxia-core/src/test/java/org/apache/maven/doxia/parser/AbstractParserTest.java:
##########
@@ -146,6 +156,91 @@ public final void testSinkWrapper() throws ParseException,
IOException {
}
}
+ /**
+ * Override this method if the parser always emits some static prefix for
incomplete documents
+ * and consume the prefix related events from the given {@link Iterator}.
+ * @param eventIterator the iterator
+ */
+ protected void assertEventPrefix(Iterator<SinkEventElement> eventIterator)
{
+ // do nothing by default, i.e. assume no prefix
+ }
+
+ /**
+ * Override this method if the parser always emits some static suffix for
incomplete documents
+ * and consume the suffix related events from the given {@link Iterator}.
+ * @param eventIterator the iterator
+ */
+ protected void assertEventSuffix(Iterator<SinkEventElement> eventIterator)
{
+ assertFalse(eventIterator.hasNext(), "didn't expect any further events
but got at least one");
+ }
+
+ /**
+ * @return markup representing the verbatim text {@value
#TEXT_WITH_SPECIAL_CHARS} (needs to be properly escaped).
+ * {@code null} can be returned to skip the test for a particular parser.
+ */
+ protected abstract String getVerbatimSource();
+
+ /**
+ * Test a verbatim block (no code) given through {@link
#getVerbatimSource()}
+ * @throws ParseException
+ */
+ @Test
+ public void testVerbatim() throws ParseException {
+ String source = getVerbatimSource();
+ assumeTrue(source != null, "parser does not support simple verbatim
text");
Review Comment:
Interesting...
> Simplify HTML emitted from Sink.verbatim(...)
> ---------------------------------------------
>
> Key: DOXIA-731
> URL: https://issues.apache.org/jira/browse/DOXIA-731
> Project: Maven Doxia
> Issue Type: Improvement
> Components: Core
> Affects Versions: 2.0.0-M9
> Reporter: Konrad Windszus
> Assignee: Konrad Windszus
> Priority: Major
>
> The XHTML markup generated from Sink.verbatim(...) should be streamlined to
> either emit {{<pre>}} or {{<pre><code>}} depending on the given attribute.
> There is no need to generate an additional div nor any additional classes.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)