p:markdown-to-text 001 (NW)
Smoke test for the p:markdown-to-text step.
Test is expected to pass.
The pipeline
<p:declare-step xmlns:err="http://www.w3.org/ns/xproc-error"
xmlns:p="http://www.w3.org/ns/xproc"
xmlns:t="http://xproc.org/ns/testsuite/3.0" xmlns:test="http://test" version="3.0">
<p:output port="result"/>
<p:markdown-to-html>
<p:with-input>
<p:inline content-type="text/plain">This is some *bold* text.</p:inline>
</p:with-input>
</p:markdown-to-html>
</p:declare-step>
Result
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:t="http://xproc.org/ns/testsuite/3.0">
<head/>
<body>
<p>This is some <em>bold</em> text.</p>
</body>
</html>
Schematron checks
<s:schema xmlns="http://www.w3.org/1999/xhtml"
xmlns:err="http://www.w3.org/ns/xproc-error"
xmlns:s="http://purl.oclc.org/dsdl/schematron" xmlns:t="http://xproc.org/ns/testsuite/3.0"
queryBinding="xslt2">
<s:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
<s:pattern>
<s:rule context="/">
<s:assert test="h:html">Root element is not 'html'.</s:assert>
<s:assert test="h:html/h:head">HTML head element is missing.</s:assert>
<s:assert test="h:html/h:body">HTML body element is missing.</s:assert>
<s:assert test="h:html/h:body/h:p">HTML body has no paragraph.</s:assert>
<s:assert test="h:html/h:body/h:p/(h:em|h:b)">HTML paragraph has no emphasis.</s:assert>
<s:assert test="h:html/h:body/h:p[starts-with(., 'This is some')]">HTML paragraph has wrong text.</s:assert>
</s:rule>
</s:pattern>
</s:schema>
Revision history
- 15 Jun 2024, Achim Berndzen
- Just added features attribute to mark depencies.
- 18 May 2024, Norm Tovey-Walsh
- Created test for p:markdown-to-text.