Lines Matching +full:- +full:s
6 * Roundtrip tests driven by GFM's spec.txt.
8 * Each example in gfm-spec/spec.txt becomes one data-provider case. The
9 * markdown input is run through DokuWiki's full pipeline (parser + XHTML
11 * tolerating whitespace differences around block-level tags.
13 * `gfm-spec/skip.php` lists examples that are deliberately out of scope
14 * for DokuWiki (e.g. CommonMark flanking-delimiter edge cases). Those are
19 private const FIXTURE_DIR = __DIR__ . '/gfm-spec/';
29 // real tab-handling behavior, not arrow-character handling.
30 foreach ($reader->examples() as $ex) {
32 $label = sprintf('#%d %s', $ex['number'], $ex['section']);
45 $this->markTestSkipped($skipReason);
47 $actual = $this->renderMarkdown($md);
48 $this->assertHtmlEquals($expected, $actual);
52 * Render markdown text through DokuWiki's full parser pipeline under
56 * this override exists so spec output can be compared byte-for-byte.
61 * correct for production wiki prose but diverge byte-for-byte from
63 * Entity-table substitutions (--, ---, ->, (c), ...) at render time;
66 * The renderer's acronym table is left empty so the parser-emitted
79 $renderer->reset();
80 $renderer->smileys = getSmileys();
81 $renderer->entities = getEntities();
82 $renderer->acronyms = [];
83 $renderer->interwiki = getInterwiki();
90 return $renderer->doc;
96 * DokuWiki's XHTML renderer emits extra whitespace around block tags
97 * that the spec's reference HTML omits. The comparator strips whitespace
98 * only around **block-level** tags (p, div, h1-h6, ul/ol/li, table/tr/td,
105 $this->assertEquals(
106 $this->normalizeHtml($expected),
107 $this->normalizeHtml($actual)
112 * Strip whitespace adjacent to block-level tags; leave inline tags alone.
114 * Additionally drops DokuWiki-specific heading decoration that carries no
115 * semantic meaning for GFM-conformance checks:
117 * - `<div class="levelN">` / matching `</div>` section wrappers the
119 * - `class="..."` / `id="..."` attributes on h1-h6 (section-edit anchor
120 * and header-id generation; fine to ignore, the spec output has none).
124 $block = 'p|div|h[1-6]|hr|ul|ol|li|blockquote|pre|table|thead|tbody|tfoot|tr|th|td';
126 // Drop DokuWiki's `<div class="levelN">` section wrappers and the
127 // HTML comments (`<!-- EDIT... -->`) its section-edit machinery
130 $html = preg_replace('#<div class="level[1-6]">\s*#', '', $html);
131 $html = preg_replace('#\s*</div>\s*#', '', $html);
132 $html = preg_replace('#<!--[^<]*?-->#', '', $html);
135 $html = preg_replace('#<(h[1-6])(?:\s+(?:class|id)="[^"]*")+\s*>#', '<$1>', $html);
138 $html = preg_replace('#\s*<(' . $block . ')((?:\s[^>]*)?)>\s*#', '<$1$2>', $html);
140 $html = preg_replace('#\s*</(' . $block . ')>\s*#', '</$1>', $html);