Permalink
Browse files

fix #16 missing space_after_headers extension

  • Loading branch information...
chobie committed Apr 21, 2012
1 parent 0ded914 commit f75ce2c4f6fc7f605ba8970f9ec526bcdce2bc56
Showing with 24 additions and 1 deletion.
  1. +1 −1 php_sundown.h
  2. +23 −0 tests/004-render-extensions-space_after_headers.phpt
View
@@ -282,7 +282,7 @@ static void php_sundown__get_extensions(HashTable *table, unsigned int *enabled_
extensions |= MKDEXT_LAX_HTML_BLOCKS;
}
- if (SUNDOWN_HAS_EXTENSION("space_after_header")) {
+ if (SUNDOWN_HAS_EXTENSION("space_after_headers")) {
extensions |= MKDEXT_SPACE_HEADERS;
}
@@ -0,0 +1,23 @@
+--TEST--
+check for space_after_headers behavior
+--SKIPIF--
+<?php if (!extension_loaded("sundown")) print "skip"; ?>
+--FILE--
+<?php
+$data = <<<EOF
+#Level1
+EOF;
+
+echo "space_after_headers disabled:\n";
+$a = new Sundown\Markdown(new Sundown\Render\HTML(), array("space_after_headers"=>false));
+echo $a->render($data);
+echo PHP_EOL;
+echo "space_after_headers enabled:\n";
+$a = new Sundown\Markdown(new Sundown\Render\HTML(), array("space_after_headers"=>true));
+echo $a->render($data);
+--EXPECT--
+space_after_headers disabled:
+<h1>Level1</h1>
+
+space_after_headers enabled:
+<p>#Level1</p>

0 comments on commit f75ce2c

Please sign in to comment.