Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
  • 2 commits
  • 107 files changed
  • 0 commit comments
  • 2 contributors
Commits on Sep 06, 2012
@hitode909 hitode909 upgraded discount to 2.1.5a b6a4001
Commits on Sep 13, 2012
@sekimura Merge pull request #2 from hitode909/215a
upgraded discount to 2.1.5a
cfadff0
Showing with 753 additions and 422 deletions.
  1. +41 −41 .gitignore
  2. +95 −100 MANIFEST
  3. +44 −44 MANIFEST.SKIP
  4. +1 −1  Makefile.PL
  5. +0 −1  discount-2.1.2/VERSION
  6. 0  {discount-2.1.2 → discount-2.1.5a}/COPYRIGHT
  7. 0  {discount-2.1.2 → discount-2.1.5a}/CREDITS
  8. +1 −1  {discount-2.1.2 → discount-2.1.5a}/Csio.c
  9. 0  {discount-2.1.2 → discount-2.1.5a}/INSTALL
  10. +33 −29 {discount-2.1.2 → discount-2.1.5a}/Makefile.in
  11. 0  {discount-2.1.2 → discount-2.1.5a}/Plan9/README
  12. 0  {discount-2.1.2 → discount-2.1.5a}/Plan9/markdown.1
  13. 0  {discount-2.1.2 → discount-2.1.5a}/Plan9/markdown.2
  14. 0  {discount-2.1.2 → discount-2.1.5a}/Plan9/markdown.6
  15. 0  {discount-2.1.2 → discount-2.1.5a}/Plan9/mkfile
  16. 0  {discount-2.1.2 → discount-2.1.5a}/README
  17. +1 −0  discount-2.1.5a/VERSION
  18. 0  {discount-2.1.2 → discount-2.1.5a}/amalloc.c
  19. 0  {discount-2.1.2 → discount-2.1.5a}/amalloc.h
  20. 0  {discount-2.1.2 → discount-2.1.5a}/basename.c
  21. +88 −58 {discount-2.1.2 → discount-2.1.5a}/configure.inc
  22. +15 −4 {discount-2.1.2 → discount-2.1.5a}/configure.sh
  23. 0  {discount-2.1.2 → discount-2.1.5a}/css.c
  24. +2 −2 {discount-2.1.2 → discount-2.1.5a}/cstring.h
  25. 0  {discount-2.1.2 → discount-2.1.5a}/docheader.c
  26. 0  {discount-2.1.2 → discount-2.1.5a}/dumptree.c
  27. 0  {discount-2.1.2 → discount-2.1.5a}/emmatch.c
  28. +1 −0  {discount-2.1.2 → discount-2.1.5a}/flags.c
  29. +82 −47 {discount-2.1.2 → discount-2.1.5a}/generate.c
  30. +100 −0 discount-2.1.5a/github_flavoured.c
  31. 0  {discount-2.1.2 → discount-2.1.5a}/html5.c
  32. +24 −7 {discount-2.1.2 → discount-2.1.5a}/main.c
  33. 0  {discount-2.1.2 → discount-2.1.5a}/makepage.1
  34. +0 −1  {discount-2.1.2 → discount-2.1.5a}/makepage.c
  35. +11 −3 {discount-2.1.2 → discount-2.1.5a}/markdown.1
  36. 0  {discount-2.1.2 → discount-2.1.5a}/markdown.3
  37. 0  {discount-2.1.2 → discount-2.1.5a}/markdown.7
  38. +29 −13 {discount-2.1.2 → discount-2.1.5a}/markdown.c
  39. +33 −4 {discount-2.1.2 → discount-2.1.5a}/markdown.h
  40. 0  {discount-2.1.2 → discount-2.1.5a}/mkd-callbacks.3
  41. 0  {discount-2.1.2 → discount-2.1.5a}/mkd-extensions.7
  42. 0  {discount-2.1.2 → discount-2.1.5a}/mkd-functions.3
  43. 0  {discount-2.1.2 → discount-2.1.5a}/mkd-line.3
  44. 0  {discount-2.1.2 → discount-2.1.5a}/mkd2html.1
  45. +17 −11 {discount-2.1.2 → discount-2.1.5a}/mkd2html.c
  46. +18 −24 {discount-2.1.2 → discount-2.1.5a}/mkdio.c
  47. +6 −0 {discount-2.1.2 → discount-2.1.5a}/mkdio.h.in
  48. +0 −2  {discount-2.1.2 → discount-2.1.5a}/mktags.c
  49. +5 −2 {discount-2.1.2 → discount-2.1.5a}/pgm_options.c
  50. 0  {discount-2.1.2 → discount-2.1.5a}/pgm_options.h
  51. 0  {discount-2.1.2 → discount-2.1.5a}/resource.c
  52. 0  {discount-2.1.2 → discount-2.1.5a}/setup.c
  53. 0  {discount-2.1.2 → discount-2.1.5a}/tags.c
  54. 0  {discount-2.1.2 → discount-2.1.5a}/tags.h
  55. 0  {discount-2.1.2 → discount-2.1.5a}/tests/autolink.t
  56. 0  {discount-2.1.2 → discount-2.1.5a}/tests/automatic.t
  57. 0  {discount-2.1.2 → discount-2.1.5a}/tests/backslash.t
  58. 0  {discount-2.1.2 → discount-2.1.5a}/tests/callbacks.t
  59. 0  {discount-2.1.2 → discount-2.1.5a}/tests/chrome.text
  60. +15 −0 {discount-2.1.2 → discount-2.1.5a}/tests/code.t
  61. 0  {discount-2.1.2 → discount-2.1.5a}/tests/compat.t
  62. 0  {discount-2.1.2 → discount-2.1.5a}/tests/crash.t
  63. +17 −0 discount-2.1.5a/tests/defects.t
  64. 0  {discount-2.1.2 → discount-2.1.5a}/tests/div.t
  65. 0  {discount-2.1.2 → discount-2.1.5a}/tests/dl.t
  66. 0  {discount-2.1.2 → discount-2.1.5a}/tests/embedlinks.text
  67. 0  {discount-2.1.2 → discount-2.1.5a}/tests/emphasis.t
  68. 0  {discount-2.1.2 → discount-2.1.5a}/tests/extrafootnotes.t
  69. 0  {discount-2.1.2 → discount-2.1.5a}/tests/flow.t
  70. 0  {discount-2.1.2 → discount-2.1.5a}/tests/footnotes.t
  71. 0  {discount-2.1.2 → discount-2.1.5a}/tests/functions.sh
  72. 0  {discount-2.1.2 → discount-2.1.5a}/tests/header.t
  73. +0 −9 {discount-2.1.2 → discount-2.1.5a}/tests/html.t
  74. 0  {discount-2.1.2 → discount-2.1.5a}/tests/html5.t
  75. 0  {discount-2.1.2 → discount-2.1.5a}/tests/links.text
  76. 0  {discount-2.1.2 → discount-2.1.5a}/tests/linkylinky.t
  77. 0  {discount-2.1.2 → discount-2.1.5a}/tests/linkypix.t
  78. 0  {discount-2.1.2 → discount-2.1.5a}/tests/list.t
  79. 0  {discount-2.1.2 → discount-2.1.5a}/tests/list3deep.t
  80. 0  {discount-2.1.2 → discount-2.1.5a}/tests/misc.t
  81. 0  {discount-2.1.2 → discount-2.1.5a}/tests/pandoc.t
  82. 0  {discount-2.1.2 → discount-2.1.5a}/tests/para.t
  83. 0  {discount-2.1.2 → discount-2.1.5a}/tests/paranoia.t
  84. 0  {discount-2.1.2 → discount-2.1.5a}/tests/peculiarities.t
  85. 0  {discount-2.1.2 → discount-2.1.5a}/tests/pseudo.t
  86. 0  {discount-2.1.2 → discount-2.1.5a}/tests/reddit.t
  87. 0  {discount-2.1.2 → discount-2.1.5a}/tests/reparse.t
  88. 0  {discount-2.1.2 → discount-2.1.5a}/tests/schiraldi.t
  89. 0  {discount-2.1.2 → discount-2.1.5a}/tests/smarty.t
  90. 0  {discount-2.1.2 → discount-2.1.5a}/tests/snakepit.t
  91. 0  {discount-2.1.2 → discount-2.1.5a}/tests/strikethrough.t
  92. +2 −0  {discount-2.1.2 → discount-2.1.5a}/tests/style.t
  93. 0  {discount-2.1.2 → discount-2.1.5a}/tests/superscript.t
  94. 0  {discount-2.1.2 → discount-2.1.5a}/tests/syntax.text
  95. +22 −0 {discount-2.1.2 → discount-2.1.5a}/tests/tables.t
  96. 0  {discount-2.1.2 → discount-2.1.5a}/tests/tabstop.t
  97. +8 −4 {discount-2.1.2 → discount-2.1.5a}/tests/toc.t
  98. 0  {discount-2.1.2 → discount-2.1.5a}/tests/xml.t
  99. +2 −0  {discount-2.1.2 → discount-2.1.5a}/theme.1
  100. +19 −4 {discount-2.1.2 → discount-2.1.5a}/theme.c
  101. +21 −10 {discount-2.1.2 → discount-2.1.5a}/toc.c
  102. 0  {discount-2.1.2 → discount-2.1.5a}/tools/checkbits.sh
  103. 0  {discount-2.1.2 → discount-2.1.5a}/tools/cols.c
  104. 0  {discount-2.1.2 → discount-2.1.5a}/tools/echo.c
  105. 0  {discount-2.1.2 → discount-2.1.5a}/version.c.in
  106. 0  {discount-2.1.2 → discount-2.1.5a}/xml.c
  107. 0  {discount-2.1.2 → discount-2.1.5a}/xmlpage.c
View
82 .gitignore
@@ -6,44 +6,44 @@ Discount.c
Discount.o
pm_to_blib
*.swp
-discount-2.1.2/Csio.o
-discount-2.1.2/basename.o
-discount-2.1.2/blocktags
-discount-2.1.2/cols
-discount-2.1.2/config.cmd
-discount-2.1.2/config.h
-discount-2.1.2/config.log
-discount-2.1.2/config.mak
-discount-2.1.2/config.md
-discount-2.1.2/config.sub
-discount-2.1.2/css.o
-discount-2.1.2/docheader.o
-discount-2.1.2/dumptree.o
-discount-2.1.2/echo
-discount-2.1.2/emmatch.o
-discount-2.1.2/flags.o
-discount-2.1.2/generate.o
-discount-2.1.2/html5.o
-discount-2.1.2/libmarkdown
-discount-2.1.2/libmarkdown.a
-discount-2.1.2/librarian.sh
-discount-2.1.2/main.o
-discount-2.1.2/makepage
-discount-2.1.2/markdown
-discount-2.1.2/markdown.o
-discount-2.1.2/mkd2html
-discount-2.1.2/mkd2html.o
-discount-2.1.2/mkdio.h
-discount-2.1.2/mkdio.o
-discount-2.1.2/mktags
-discount-2.1.2/pgm_options.o
-discount-2.1.2/resource.o
-discount-2.1.2/setup.o
-discount-2.1.2/tags.o
-discount-2.1.2/theme
-discount-2.1.2/theme.o
-discount-2.1.2/toc.o
-discount-2.1.2/version.c
-discount-2.1.2/version.o
-discount-2.1.2/xml.o
-discount-2.1.2/xmlpage.o
+discount-2.1.5a/Csio.o
+discount-2.1.5a/basename.o
+discount-2.1.5a/blocktags
+discount-2.1.5a/cols
+discount-2.1.5a/config.cmd
+discount-2.1.5a/config.h
+discount-2.1.5a/config.log
+discount-2.1.5a/config.mak
+discount-2.1.5a/config.md
+discount-2.1.5a/config.sub
+discount-2.1.5a/css.o
+discount-2.1.5a/docheader.o
+discount-2.1.5a/dumptree.o
+discount-2.1.5a/echo
+discount-2.1.5a/emmatch.o
+discount-2.1.5a/flags.o
+discount-2.1.5a/generate.o
+discount-2.1.5a/html5.o
+discount-2.1.5a/libmarkdown
+discount-2.1.5a/libmarkdown.a
+discount-2.1.5a/librarian.sh
+discount-2.1.5a/main.o
+discount-2.1.5a/makepage
+discount-2.1.5a/markdown
+discount-2.1.5a/markdown.o
+discount-2.1.5a/mkd2html
+discount-2.1.5a/mkd2html.o
+discount-2.1.5a/mkdio.h
+discount-2.1.5a/mkdio.o
+discount-2.1.5a/mktags
+discount-2.1.5a/pgm_options.o
+discount-2.1.5a/resource.o
+discount-2.1.5a/setup.o
+discount-2.1.5a/tags.o
+discount-2.1.5a/theme
+discount-2.1.5a/theme.o
+discount-2.1.5a/toc.o
+discount-2.1.5a/version.c
+discount-2.1.5a/version.o
+discount-2.1.5a/xml.o
+discount-2.1.5a/xmlpage.o
View
195 MANIFEST
@@ -1,10 +1,105 @@
.gitignore
Changes
+discount-2.1.5a/amalloc.c
+discount-2.1.5a/amalloc.h
+discount-2.1.5a/basename.c
+discount-2.1.5a/configure.inc
+discount-2.1.5a/configure.sh
+discount-2.1.5a/COPYRIGHT
+discount-2.1.5a/CREDITS
+discount-2.1.5a/Csio.c
+discount-2.1.5a/css.c
+discount-2.1.5a/cstring.h
+discount-2.1.5a/docheader.c
+discount-2.1.5a/dumptree.c
+discount-2.1.5a/emmatch.c
+discount-2.1.5a/flags.c
+discount-2.1.5a/generate.c
+discount-2.1.5a/github_flavoured.c
+discount-2.1.5a/github_flavoured.o
+discount-2.1.5a/html5.c
+discount-2.1.5a/INSTALL
+discount-2.1.5a/main.c
+discount-2.1.5a/Makefile
+discount-2.1.5a/Makefile.in
+discount-2.1.5a/mkd-callbacks.3
+discount-2.1.5a/mkd-extensions.7
+discount-2.1.5a/mkd-functions.3
+discount-2.1.5a/mkd-line.3
+discount-2.1.5a/mkdio.c
+discount-2.1.5a/pgm_options.c
+discount-2.1.5a/pgm_options.h
+discount-2.1.5a/Plan9/markdown.1
+discount-2.1.5a/Plan9/markdown.2
+discount-2.1.5a/Plan9/markdown.6
+discount-2.1.5a/Plan9/mkfile
+discount-2.1.5a/Plan9/README
+discount-2.1.5a/README
+discount-2.1.5a/resource.c
+discount-2.1.5a/setup.c
+discount-2.1.5a/tags.c
+discount-2.1.5a/tags.h
+discount-2.1.5a/tests/autolink.t
+discount-2.1.5a/tests/automatic.t
+discount-2.1.5a/tests/backslash.t
+discount-2.1.5a/tests/callbacks.t
+discount-2.1.5a/tests/chrome.text
+discount-2.1.5a/tests/code.t
+discount-2.1.5a/tests/compat.t
+discount-2.1.5a/tests/crash.t
+discount-2.1.5a/tests/defects.t
+discount-2.1.5a/tests/div.t
+discount-2.1.5a/tests/dl.t
+discount-2.1.5a/tests/embedlinks.text
+discount-2.1.5a/tests/emphasis.t
+discount-2.1.5a/tests/extrafootnotes.t
+discount-2.1.5a/tests/flow.t
+discount-2.1.5a/tests/footnotes.t
+discount-2.1.5a/tests/functions.sh
+discount-2.1.5a/tests/header.t
+discount-2.1.5a/tests/html.t
+discount-2.1.5a/tests/html5.t
+discount-2.1.5a/tests/links.text
+discount-2.1.5a/tests/linkylinky.t
+discount-2.1.5a/tests/linkypix.t
+discount-2.1.5a/tests/list.t
+discount-2.1.5a/tests/list3deep.t
+discount-2.1.5a/tests/misc.t
+discount-2.1.5a/tests/pandoc.t
+discount-2.1.5a/tests/para.t
+discount-2.1.5a/tests/paranoia.t
+discount-2.1.5a/tests/peculiarities.t
+discount-2.1.5a/tests/pseudo.t
+discount-2.1.5a/tests/reddit.t
+discount-2.1.5a/tests/reparse.t
+discount-2.1.5a/tests/schiraldi.t
+discount-2.1.5a/tests/smarty.t
+discount-2.1.5a/tests/snakepit.t
+discount-2.1.5a/tests/strikethrough.t
+discount-2.1.5a/tests/style.t
+discount-2.1.5a/tests/superscript.t
+discount-2.1.5a/tests/syntax.text
+discount-2.1.5a/tests/tables.t
+discount-2.1.5a/tests/tabstop.t
+discount-2.1.5a/tests/toc.t
+discount-2.1.5a/tests/xml.t
+discount-2.1.5a/toc.c
+discount-2.1.5a/tools/checkbits.sh
+discount-2.1.5a/tools/cols.c
+discount-2.1.5a/tools/echo.c
+discount-2.1.5a/VERSION
+discount-2.1.5a/xml.c
+discount-2.1.5a/xmlpage.c
+Discount.bs
+Discount.c
+Discount.o
Discount.xs
INSTALL.Discount
lib/Text/Markdown/Discount.pm
Makefile.PL
MANIFEST
+MYMETA.json
+MYMETA.yml
ppport.h
README
t/00.load.t
@@ -58,103 +153,3 @@ xt/MarkdownTest_1.0.3/Tests/Tidyness.html
xt/MarkdownTest_1.0.3/Tests/Tidyness.text
xt/MarkdownXS.pl
xt/test.pl
-discount-2.1.2/markdown.1
-discount-2.1.2/configure.inc
-discount-2.1.2/main.c
-discount-2.1.2/theme.c
-discount-2.1.2/mktags.c
-discount-2.1.2/mkd-callbacks.3
-discount-2.1.2/VERSION
-discount-2.1.2/COPYRIGHT
-discount-2.1.2/configure.sh
-discount-2.1.2/theme.1
-discount-2.1.2/Csio.c
-discount-2.1.2/cstring.h
-discount-2.1.2/markdown.3
-discount-2.1.2/README
-discount-2.1.2/amalloc.c
-discount-2.1.2/pgm_options.h
-discount-2.1.2/mkd-functions.3
-discount-2.1.2/mkdio.c
-discount-2.1.2/resource.c
-discount-2.1.2/xml.c
-discount-2.1.2/dumptree.c
-discount-2.1.2/INSTALL
-discount-2.1.2/mkdio.h.in
-discount-2.1.2/tools/cols.c
-discount-2.1.2/tools/checkbits.sh
-discount-2.1.2/tools/echo.c
-discount-2.1.2/amalloc.h
-discount-2.1.2/flags.c
-discount-2.1.2/mkd2html.1
-discount-2.1.2/generate.c
-discount-2.1.2/makepage.c
-discount-2.1.2/html5.c
-discount-2.1.2/Makefile.in
-discount-2.1.2/CREDITS
-discount-2.1.2/pgm_options.c
-discount-2.1.2/xmlpage.c
-discount-2.1.2/docheader.c
-discount-2.1.2/tags.c
-discount-2.1.2/markdown.h
-discount-2.1.2/version.c.in
-discount-2.1.2/toc.c
-discount-2.1.2/markdown.7
-discount-2.1.2/mkd-extensions.7
-discount-2.1.2/setup.c
-discount-2.1.2/makepage.1
-discount-2.1.2/mkd-line.3
-discount-2.1.2/tests/list.t
-discount-2.1.2/tests/para.t
-discount-2.1.2/tests/crash.t
-discount-2.1.2/tests/misc.t
-discount-2.1.2/tests/autolink.t
-discount-2.1.2/tests/code.t
-discount-2.1.2/tests/list3deep.t
-discount-2.1.2/tests/pandoc.t
-discount-2.1.2/tests/linkylinky.t
-discount-2.1.2/tests/div.t
-discount-2.1.2/tests/embedlinks.text
-discount-2.1.2/tests/dl.t
-discount-2.1.2/tests/tabstop.t
-discount-2.1.2/tests/functions.sh
-discount-2.1.2/tests/links.text
-discount-2.1.2/tests/footnotes.t
-discount-2.1.2/tests/html.t
-discount-2.1.2/tests/header.t
-discount-2.1.2/tests/chrome.text
-discount-2.1.2/tests/pseudo.t
-discount-2.1.2/tests/schiraldi.t
-discount-2.1.2/tests/extrafootnotes.t
-discount-2.1.2/tests/flow.t
-discount-2.1.2/tests/reparse.t
-discount-2.1.2/tests/snakepit.t
-discount-2.1.2/tests/xml.t
-discount-2.1.2/tests/peculiarities.t
-discount-2.1.2/tests/tables.t
-discount-2.1.2/tests/strikethrough.t
-discount-2.1.2/tests/emphasis.t
-discount-2.1.2/tests/automatic.t
-discount-2.1.2/tests/compat.t
-discount-2.1.2/tests/callbacks.t
-discount-2.1.2/tests/linkypix.t
-discount-2.1.2/tests/style.t
-discount-2.1.2/tests/superscript.t
-discount-2.1.2/tests/html5.t
-discount-2.1.2/tests/paranoia.t
-discount-2.1.2/tests/smarty.t
-discount-2.1.2/tests/backslash.t
-discount-2.1.2/tests/reddit.t
-discount-2.1.2/tests/toc.t
-discount-2.1.2/tests/syntax.text
-discount-2.1.2/basename.c
-discount-2.1.2/tags.h
-discount-2.1.2/emmatch.c
-discount-2.1.2/mkd2html.c
-discount-2.1.2/markdown.c
-discount-2.1.2/Plan9/markdown.1
-discount-2.1.2/Plan9/markdown.6
-discount-2.1.2/Plan9/README
-discount-2.1.2/Plan9/markdown.2
-discount-2.1.2/Plan9/mkfile
-discount-2.1.2/css.c
View
88 MANIFEST.SKIP
@@ -12,47 +12,47 @@
\.gz$
\.cvsignore
\.shipit
-^discount-2.1.2/Csio.o
-^discount-2.1.2/basename.o
-^discount-2.1.2/blocktags
-^discount-2.1.2/cols
-^discount-2.1.2/config.cmd
-^discount-2.1.2/config.h
-^discount-2.1.2/config.log
-^discount-2.1.2/config.mak
-^discount-2.1.2/config.md
-^discount-2.1.2/config.sub
-^discount-2.1.2/css.o
-^discount-2.1.2/docheader.o
-^discount-2.1.2/dumptree.o
-^discount-2.1.2/echo
-^discount-2.1.2/emmatch.o
-^discount-2.1.2/flags.o
-^discount-2.1.2/generate.o
-^discount-2.1.2/html5.o
-^discount-2.1.2/libmarkdown
-^discount-2.1.2/libmarkdown.a
-^discount-2.1.2/librarian.sh
-^discount-2.1.2/main.o
-^discount-2.1.2/makepage
-^discount-2.1.2/markdown
-^discount-2.1.2/markdown.o
-^discount-2.1.2/mkd2html
-^discount-2.1.2/mkd2html.o
-^discount-2.1.2/mkdio.h
-^discount-2.1.2/mkdio.o
-^discount-2.1.2/mktags
-^discount-2.1.2/pgm_options.o
-^discount-2.1.2/resource.o
-^discount-2.1.2/setup.o
-^discount-2.1.2/tags.o
-^discount-2.1.2/theme
-^discount-2.1.2/theme.o
-^discount-2.1.2/toc.o
-^discount-2.1.2/theme
-^discount-2.1.2/theme.o
-^discount-2.1.2/toc.o
-^discount-2.1.2/version.c
-^discount-2.1.2/version.o
-^discount-2.1.2/xml.o
-^discount-2.1.2/xmlpage.o
+^discount-2.1.5a/Csio.o
+^discount-2.1.5a/basename.o
+^discount-2.1.5a/blocktags
+^discount-2.1.5a/cols
+^discount-2.1.5a/config.cmd
+^discount-2.1.5a/config.h
+^discount-2.1.5a/config.log
+^discount-2.1.5a/config.mak
+^discount-2.1.5a/config.md
+^discount-2.1.5a/config.sub
+^discount-2.1.5a/css.o
+^discount-2.1.5a/docheader.o
+^discount-2.1.5a/dumptree.o
+^discount-2.1.5a/echo
+^discount-2.1.5a/emmatch.o
+^discount-2.1.5a/flags.o
+^discount-2.1.5a/generate.o
+^discount-2.1.5a/html5.o
+^discount-2.1.5a/libmarkdown
+^discount-2.1.5a/libmarkdown.a
+^discount-2.1.5a/librarian.sh
+^discount-2.1.5a/main.o
+^discount-2.1.5a/makepage
+^discount-2.1.5a/markdown
+^discount-2.1.5a/markdown.o
+^discount-2.1.5a/mkd2html
+^discount-2.1.5a/mkd2html.o
+^discount-2.1.5a/mkdio.h
+^discount-2.1.5a/mkdio.o
+^discount-2.1.5a/mktags
+^discount-2.1.5a/pgm_options.o
+^discount-2.1.5a/resource.o
+^discount-2.1.5a/setup.o
+^discount-2.1.5a/tags.o
+^discount-2.1.5a/theme
+^discount-2.1.5a/theme.o
+^discount-2.1.5a/toc.o
+^discount-2.1.5a/theme
+^discount-2.1.5a/theme.o
+^discount-2.1.5a/toc.o
+^discount-2.1.5a/version.c
+^discount-2.1.5a/version.o
+^discount-2.1.5a/xml.o
+^discount-2.1.5a/xmlpage.o
View
2  Makefile.PL
@@ -4,7 +4,7 @@ use warnings;
use ExtUtils::MakeMaker;
use File::Spec;
-my $extdir = 'discount-2.1.2';
+my $extdir = 'discount-2.1.5a';
my $myextlib = File::Spec->catfile($extdir, 'libmarkdown.a');
my $clean_files = join (" ",
map{ File::Spec->catfile($extdir, $_) }
View
1  discount-2.1.2/VERSION
@@ -1 +0,0 @@
-2.1.2
View
0  discount-2.1.2/COPYRIGHT → discount-2.1.5a/COPYRIGHT
File renamed without changes
View
0  discount-2.1.2/CREDITS → discount-2.1.5a/CREDITS
File renamed without changes
View
2  discount-2.1.2/Csio.c → discount-2.1.5a/Csio.c
@@ -54,7 +54,7 @@ Csreparse(Cstring *iot, char *buf, int size, int flags)
{
MMIOT f;
___mkd_initmmiot(&f, 0);
- ___mkd_reparse(buf, size, 0, &f);
+ ___mkd_reparse(buf, size, 0, &f, 0);
___mkd_emblock(&f);
SUFFIX(*iot, T(f.out), S(f.out));
___mkd_freemmiot(&f, 0);
View
0  discount-2.1.2/INSTALL → discount-2.1.5a/INSTALL
File renamed without changes
View
62 discount-2.1.2/Makefile.in → discount-2.1.5a/Makefile.in
@@ -1,4 +1,5 @@
-CC=@CC@ -I. -L.
+CC=@CC@ -I.
+LFLAGS=-L.
CFLAGS=@CFLAGS@
AR=@AR@
RANLIB=@RANLIB@
@@ -15,56 +16,59 @@ MKDLIB=libmarkdown
OBJS=mkdio.o markdown.o dumptree.o generate.o \
resource.o docheader.o version.o toc.o css.o \
xml.o Csio.o xmlpage.o basename.o emmatch.o \
- setup.o tags.o html5.o flags.o @AMALLOC@
+ github_flavoured.o setup.o tags.o html5.o flags.o @AMALLOC@
TESTFRAMEWORK=echo cols
MAN3PAGES=mkd-callbacks.3 mkd-functions.3 markdown.3 mkd-line.3
all: $(PGMS) $(SAMPLE_PGMS) $(TESTFRAMEWORK)
-install: $(PGMS) $(DESTDIR)/$(BINDIR) $(DESTDIR)/$(LIBDIR) $(DESTDIR)/$(INCDIR)
- @INSTALL_PROGRAM@ $(PGMS) $(DESTDIR)/$(BINDIR)
- ./librarian.sh install libmarkdown VERSION $(DESTDIR)/$(LIBDIR)
- @INSTALL_DATA@ mkdio.h $(DESTDIR)/$(INCDIR)
+install: $(PGMS) $(DESTDIR)$(BINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(INCDIR)
+ @INSTALL_PROGRAM@ $(PGMS) $(DESTDIR)$(BINDIR)
+ ./librarian.sh install libmarkdown VERSION $(DESTDIR)$(LIBDIR)
+ @INSTALL_DATA@ mkdio.h $(DESTDIR)$(INCDIR)
install.everything: install install.samples install.man
-install.samples: $(SAMPLE_PGMS) install $(DESTDIR)/$(BINDIR)
- @INSTALL_PROGRAM@ $(SAMPLE_PGMS) $(DESTDIR)/$(BINDIR)
- @INSTALL_DIR@ $(DESTDIR)/$(MANDIR)/man1
- @INSTALL_DATA@ theme.1 makepage.1 mkd2html.1 $(DESTDIR)/$(MANDIR)/man1
+install.samples: $(SAMPLE_PGMS) install $(DESTDIR)$(BINDIR)
+ @INSTALL_PROGRAM@ $(SAMPLE_PGMS) $(DESTDIR)$(BINDIR)
+ @INSTALL_DIR@ $(DESTDIR)$(MANDIR)/man1
+ @INSTALL_DATA@ theme.1 makepage.1 mkd2html.1 $(DESTDIR)$(MANDIR)/man1
install.man:
- @INSTALL_DIR@ $(DESTDIR)/$(MANDIR)/man3
- @INSTALL_DATA@ $(MAN3PAGES) $(DESTDIR)/$(MANDIR)/man3
+ @INSTALL_DIR@ $(DESTDIR)$(MANDIR)/man3
+ @INSTALL_DATA@ $(MAN3PAGES) $(DESTDIR)$(MANDIR)/man3
for x in mkd_line mkd_generateline; do \
- ( echo '.\"' ; echo ".so man3/mkd-line.3" ) > $(DESTDIR)/$(MANDIR)/man3/$$x.3;\
+ ( echo '.\"' ; echo ".so man3/mkd-line.3" ) > $(DESTDIR)$(MANDIR)/man3/$$x.3;\
done
for x in mkd_in mkd_string; do \
- ( echo '.\"' ; echo ".so man3/markdown.3" ) > $(DESTDIR)/$(MANDIR)/man3/$$x.3;\
+ ( echo '.\"' ; echo ".so man3/markdown.3" ) > $(DESTDIR)$(MANDIR)/man3/$$x.3;\
done
for x in mkd_compile mkd_css mkd_generatecss mkd_generatehtml mkd_cleanup mkd_doc_title mkd_doc_author mkd_doc_date; do \
- ( echo '.\"' ; echo ".so man3/mkd-functions.3" ) > $(DESTDIR)/$(MANDIR)/man3/$$x.3; \
+ ( echo '.\"' ; echo ".so man3/mkd-functions.3" ) > $(DESTDIR)$(MANDIR)/man3/$$x.3; \
done
- @INSTALL_DIR@ $(DESTDIR)/$(MANDIR)/man7
- @INSTALL_DATA@ markdown.7 mkd-extensions.7 $(DESTDIR)/$(MANDIR)/man7
- @INSTALL_DIR@ $(DESTDIR)/$(MANDIR)/man1
- @INSTALL_DATA@ markdown.1 $(DESTDIR)/$(MANDIR)/man1
+ @INSTALL_DIR@ $(DESTDIR)$(MANDIR)/man7
+ @INSTALL_DATA@ markdown.7 mkd-extensions.7 $(DESTDIR)$(MANDIR)/man7
+ @INSTALL_DIR@ $(DESTDIR)$(MANDIR)/man1
+ @INSTALL_DATA@ markdown.1 $(DESTDIR)$(MANDIR)/man1
install.everything: install install.man
-$(DESTDIR)/$(BINDIR):
- @INSTALL_DIR@ $(DESTDIR)/$(BINDIR)
+$(DESTDIR)$(BINDIR):
+ @INSTALL_DIR@ $(DESTDIR)$(BINDIR)
-$(DESTDIR)/$(INCDIR):
- @INSTALL_DIR@ $(DESTDIR)/$(INCDIR)
+$(DESTDIR)$(INCDIR):
+ @INSTALL_DIR@ $(DESTDIR)$(INCDIR)
-$(DESTDIR)/$(LIBDIR):
- @INSTALL_DIR@ $(DESTDIR)/$(LIBDIR)
+$(DESTDIR)$(LIBDIR):
+ @INSTALL_DIR@ $(DESTDIR)$(LIBDIR)
version.o: version.c VERSION
$(CC) -DVERSION=\"`cat VERSION`\" -c version.c
+VERSION:
+ @true
+
tags.o: tags.c blocktags
blocktags: mktags
@@ -72,17 +76,17 @@ blocktags: mktags
# example programs
@THEME@theme: theme.o $(MKDLIB) mkdio.h
-@THEME@ $(CC) -o theme theme.o -lmarkdown @LIBS@
+@THEME@ $(CC) $(LFLAGS) -o theme theme.o pgm_options.o -lmarkdown @LIBS@
mkd2html: mkd2html.o $(MKDLIB) mkdio.h
- $(CC) -o mkd2html mkd2html.o -lmarkdown @LIBS@
+ $(CC) $(LFLAGS) -o mkd2html mkd2html.o -lmarkdown @LIBS@
markdown: main.o pgm_options.o $(MKDLIB)
- $(CC) $(CFLAGS) -o markdown main.o pgm_options.o -lmarkdown @LIBS@
+ $(CC) $(LFLAGS) -o markdown main.o pgm_options.o -lmarkdown @LIBS@
makepage: makepage.c pgm_options.o $(MKDLIB) mkdio.h
- $(CC) $(CFLAGS) -o makepage makepage.c pgm_options.o -lmarkdown @LIBS@
+ $(CC) $(LFLAGS) -o makepage makepage.c pgm_options.o -lmarkdown @LIBS@
pgm_options.o: pgm_options.c mkdio.h config.h
$(CC) -I. -c pgm_options.c
View
0  discount-2.1.2/Plan9/README → discount-2.1.5a/Plan9/README
File renamed without changes
View
0  discount-2.1.2/Plan9/markdown.1 → discount-2.1.5a/Plan9/markdown.1
File renamed without changes
View
0  discount-2.1.2/Plan9/markdown.2 → discount-2.1.5a/Plan9/markdown.2
File renamed without changes
View
0  discount-2.1.2/Plan9/markdown.6 → discount-2.1.5a/Plan9/markdown.6
File renamed without changes
View
0  discount-2.1.2/Plan9/mkfile → discount-2.1.5a/Plan9/mkfile
File renamed without changes
View
0  discount-2.1.2/README → discount-2.1.5a/README
File renamed without changes
View
1  discount-2.1.5a/VERSION
@@ -0,0 +1 @@
+2.1.5a
View
0  discount-2.1.2/amalloc.c → discount-2.1.5a/amalloc.c
File renamed without changes
View
0  discount-2.1.2/amalloc.h → discount-2.1.5a/amalloc.h
File renamed without changes
View
0  discount-2.1.2/basename.c → discount-2.1.5a/basename.c
File renamed without changes
View
146 discount-2.1.2/configure.inc → discount-2.1.5a/configure.inc
@@ -193,8 +193,8 @@ AC_CHECK_FUNCS () {
B=`echo "$1" | sed -e 's/(.*)//'`
case "$B" in
- "$1") F="$1()" ;;
- *) F="$1" ;;
+ "$1") F="$1()"; need_proto=1 ;;
+ *) F="$1" ; unset need_proto ;;
esac
shift
@@ -205,6 +205,10 @@ AC_CHECK_FUNCS () {
shift
done
+ if [ "$need_proto" ]; then
+ echo "void $F;" >> ngc$$.c
+ fi
+
cat >> ngc$$.c << EOF
main()
{
@@ -385,8 +389,13 @@ EOF
TLOGN " ($AC_CC)"
if [ $status -eq 0 ]; then
- if $AC_CC -v 2>&1 | grep 'gcc version' >/dev/null; then
+ if $AC_CC -x c /dev/null -dM -E 2>&1 | grep '__clang__' >/dev/null; then
+ TLOG " yuck, you're using clang"
+ IS_CLANG=T
+ IS_BROKEN_CC=T
+ elif $AC_CC -v 2>&1 | grep 'gcc version' >/dev/null; then
TLOG " oh ick, it looks like gcc"
+ IS_GCC=T
IS_BROKEN_CC=T
else
TLOG " ok"
@@ -422,8 +431,6 @@ EOF
AC_FAIL " does not compile code properly"
fi
- AC_SUB 'CC' "$AC_CC"
-
__remove ngc$$ ngc$$.c ngc$$.o
return $status
@@ -874,7 +881,6 @@ say(char *w, char *v)
: "s:@%s@:%s:g\n", w, v);
}
-void
main(argc, argv)
char **argv;
{
@@ -938,6 +944,7 @@ AC_OUTPUT () {
AC_SUB 'LIBS' "$AC_LIBS"
AC_SUB 'CONFIGURE_FILES' "$__config_files"
AC_SUB 'GENERATED_FILES' "$*"
+ AC_SUB 'CC' "$AC_CC"
AC_SUB 'CFLAGS' "$AC_CFLAGS"
AC_SUB 'LDFLAGS' "$AC_LDFLAGS"
AC_SUB 'srcdir' "$AC_SRCDIR"
@@ -1166,6 +1173,8 @@ AC_CHECK_BASENAME() {
cat > ngc$$.c << EOF
#include <string.h>
+extern char *basename(char*);
+
main()
{
char *a = basename("/a/test");
@@ -1177,7 +1186,7 @@ main()
EOF
if $AC_CC -o ngc$$ ngc$$.c $LIBS; then
- if ngc$$; then
+ if ./ngc$$; then
TLOG "(found)"
AC_DEFINE 'HAVE_BASENAME' 1
AC_CHECK_HEADERS libgen.h
@@ -1212,31 +1221,16 @@ AC_COMPILER_PIC () {
return $__rc
}
-#
-# AC_CC_SHLIBS checks if the C compiler can produce shared libraries
-# and if it can writes a librarian that handles those libraries for us.
-#
-AC_CC_SHLIBS () {
- AC_PROG_CC || AC_FAIL "Need a C compiler to build shared libraries"
- AC_PROG_LN_S || AC_FAIL "Need to be able to make symbolic links for shared libraries"
- AC_PROG_INSTALL || AC_FAIL "Need an install program to install shared libraries"
- LOGN "checking whether the C compiler can build shared libraries "
- echo "int some_variable = 0;" > ngc$$.c
-
- if $AC_CC $AC_PICFLAG -shared -o ngc$$.so ngc$$.c; then
- AC_SUB LD_LIBRARY_PATH LD_LIBRARY_PATH
- # -Wl option probably works, but be paranoid anyway
- _VFLAGS="$AC_PICFLAG -shared -Wl,-soname,ngc$$.so.1"
- if $AC_CC $_VFLAGS -o ngc$$.so ngc$$.c; then
- USE_SONAME=T
- fi
- LDCONFIG=`AC_PATH=/sbin:/usr/sbin:/usr/local/sbin acLookFor ldconfig`
- __config_files="$__config_files librarian.sh"
- cat > librarian.sh << EOF
+# generate a macosX librarian
+#
+__AC_MACOS_LIBRARIAN() {
+ AC_SUB LD_LIBRARY_PATH DYLD_LIBRARY_PATH
+ __config_files="$__config_files librarian.sh"
+ cat > librarian.sh << EOF
#! /bin/sh
#
-# Build ELF shared libraries, hiding (some) ickiness from the makefile
+# Build MacOS shared libraries, hiding (some) ickiness from the makefile
ACTION=\$1; shift
LIBRARY=\$1; shift
@@ -1245,41 +1239,43 @@ eval \`awk -F. '{ printf "MAJOR=%d\n", \$1;
printf "VERSION=%d.%d.%d\n", \$1, \$2, \$3; }' \$1\`
shift
-LIBNAME=\$LIBRARY.so
-FULLNAME=\$LIBNAME.\$VERSION
+LIBNAME=\$LIBRARY.dylib
+FULLNAME=\$LIBNAME
case "\$ACTION" in
-make) FLAGS="$AC_CFLAGS -shared"
- unset VFLAGS
- test "$USE_SONAME" && VFLAGS="-Wl,-soname,\$LIBNAME.\$MAJOR"
+make) FLAGS="$AC_CFLAGS -dynamiclib"
+ VFLAGS="-current_version \$VERSION -compatibility_version \$MAJOR"
- rm -f \$LIBRARY \$LIBNAME \$LIBNAME.\$MAJOR
+ rm -f \$LIBRARY
if $AC_CC \$FLAGS \$VFLAGS -o \$FULLNAME "\$@"; then
$PROG_LN_S \$FULLNAME \$LIBRARY
- $PROG_LN_S \$FULLNAME \$LIBNAME
- $PROG_LN_S \$FULLNAME \$LIBNAME.\$MAJOR
fi
;;
-files) echo "\$FULLNAME" "\$LIBNAME" "\$LIBNAME.\$MAJOR"
+files) echo "\$FULLNAME"
;;
install)$PROG_INSTALL -c \$FULLNAME "\$1"
- $PROG_LN_S -f \$FULLNAME \$1/\$LIBNAME.\$MAJOR
- $PROG_LN_S -f \$FULLNAME \$1/\$LIBNAME
- test "$LDCONFIG" && $LDCONFIG "\$1"
;;
esac
EOF
- chmod +x librarian.sh
- LOG "(yes; -shared)"
- __rc=0
- elif $AC_CC $AC_PICFLAG -dynamiclib -o ngc$$.so ngc$$.c; then
- # macosx
- AC_SUB LD_LIBRARY_PATH DYLD_LIBRARY_PATH
- __config_files="$__config_files librarian.sh"
- cat > librarian.sh << EOF
+ chmod +x librarian.sh
+}
+
+
+# Generate an ELF librarian (for Linux, freebsd)
+#
+__AC_ELF_LIBRARIAN() {
+ AC_SUB LD_LIBRARY_PATH LD_LIBRARY_PATH
+ # -Wl option probably works, but be paranoid anyway
+ _VFLAGS="$AC_PICFLAG -shared -Wl,-soname,ngc$$.so.1"
+ if $AC_CC $_VFLAGS -o ngc$$.so ngc$$.c; then
+ USE_SONAME=T
+ fi
+ LDCONFIG=`AC_PATH=/sbin:/usr/sbin:/usr/local/sbin acLookFor ldconfig`
+ __config_files="$__config_files librarian.sh"
+ cat > librarian.sh << EOF
#! /bin/sh
#
-# Build MacOS shared libraries, hiding (some) ickiness from the makefile
+# Build ELF shared libraries, hiding (some) ickiness from the makefile
ACTION=\$1; shift
LIBRARY=\$1; shift
@@ -1288,26 +1284,60 @@ eval \`awk -F. '{ printf "MAJOR=%d\n", \$1;
printf "VERSION=%d.%d.%d\n", \$1, \$2, \$3; }' \$1\`
shift
-LIBNAME=\$LIBRARY.dylib
-FULLNAME=\$LIBNAME
+LIBNAME=\$LIBRARY.so
+FULLNAME=\$LIBNAME.\$VERSION
case "\$ACTION" in
-make) FLAGS="$AC_CFLAGS -dynamiclib"
- VFLAGS="-current_version \$VERSION -compatibility_version \$MAJOR"
+make) FLAGS="$AC_CFLAGS -shared"
+ unset VFLAGS
+ test "$USE_SONAME" && VFLAGS="-Wl,-soname,\$LIBNAME.\$MAJOR"
- rm -f \$LIBRARY
+ rm -f \$LIBRARY \$LIBNAME \$LIBNAME.\$MAJOR
if $AC_CC \$FLAGS \$VFLAGS -o \$FULLNAME "\$@"; then
$PROG_LN_S \$FULLNAME \$LIBRARY
+ $PROG_LN_S \$FULLNAME \$LIBNAME
+ $PROG_LN_S \$FULLNAME \$LIBNAME.\$MAJOR
fi
;;
-files) echo "\$FULLNAME"
+files) echo "\$FULLNAME" "\$LIBNAME" "\$LIBNAME.\$MAJOR"
;;
install)$PROG_INSTALL -c \$FULLNAME "\$1"
+ $PROG_LN_S -f \$FULLNAME \$1/\$LIBNAME.\$MAJOR
+ $PROG_LN_S -f \$FULLNAME \$1/\$LIBNAME
+ test "$LDCONFIG" && $LDCONFIG "\$1"
;;
esac
EOF
- chmod +x librarian.sh
- LOG "(yes; macos dylib)"
+ chmod +x librarian.sh
+}
+
+
+#
+# AC_CC_SHLIBS checks if the C compiler can produce shared libraries
+# and if it can writes a librarian that handles those libraries for us.
+#
+AC_CC_SHLIBS () {
+ AC_PROG_CC || AC_FAIL "Need a C compiler to build shared libraries"
+ AC_PROG_LN_S || AC_FAIL "Need to be able to make symbolic links for shared libraries"
+ AC_PROG_INSTALL || AC_FAIL "Need an install program to install shared libraries"
+ LOGN "checking whether the C compiler can build shared libraries "
+
+ echo "int some_variable = 0;" > ngc$$.c
+
+ if uname -a | grep Darwin >/dev/null; then
+ # Claims to be macos?
+ if $AC_CC $AC_PICFLAG -dynamiclib -o ngc$$.so ngc$$.c; then
+ __AC_MACOS_LIBRARIAN
+
+ LOG "(yes; macos dylib)"
+ __rc=0
+ else
+ LOG "(no)"
+ __rc=1
+ fi
+ elif $AC_CC $AC_PICFLAG -shared -o ngc$$.so ngc$$.c; then
+ __AC_ELF_LIBRARIAN
+ LOG "(yes; -shared)"
__rc=0
else
LOG "(no)"
View
19 discount-2.1.2/configure.sh → discount-2.1.5a/configure.sh
@@ -62,10 +62,21 @@ AC_PROG_CC
test "$TRY_SHARED" && AC_COMPILER_PIC && AC_CC_SHLIBS
-case "$AC_CC $AC_CFLAGS" in
-*-Wall*) AC_DEFINE 'while(x)' 'while( (x) != 0 )'
- AC_DEFINE 'if(x)' 'if( (x) != 0 )' ;;
-esac
+if [ "IS_BROKEN_CC" ]; then
+ case "$AC_CC $AC_CFLAGS" in
+ *-pedantic*) ;;
+ *) # hack around deficiencies in gcc and clang
+ #
+ AC_DEFINE 'while(x)' 'while( (x) != 0 )'
+ AC_DEFINE 'if(x)' 'if( (x) != 0 )'
+
+ if [ "$IS_CLANG" ]; then
+ AC_CC="$AC_CC -Wno-implicit-int"
+ elif [ "$IS_GCC" ]; then
+ AC_CC="$AC_CC -Wno-return-type -Wno-implicit-int"
+ fi ;;
+ esac
+fi
AC_PROG ar || AC_FAIL "$TARGET requires ar"
AC_PROG ranlib
View
0  discount-2.1.2/css.c → discount-2.1.5a/css.c
File renamed without changes
View
4 discount-2.1.2/cstring.h → discount-2.1.5a/cstring.h
@@ -27,9 +27,9 @@
#define DELETE(x) ALLOCATED(x) ? (free(T(x)), S(x) = (x).alloc = 0) \
: ( S(x) = 0 )
#define CLIP(t,i,sz) \
- ( ((i) >= 0) && ((sz) > 0) && (((i)+(sz)) <= S(t)) ) ? \
+ S(t) -= ( ((i) >= 0) && ((sz) > 0) && (((i)+(sz)) <= S(t)) ) ? \
(memmove(&T(t)[i], &T(t)[i+sz], (S(t)-(i+sz)+1)*sizeof(T(t)[0])), \
- S(t) -= (sz)) : -1
+ (sz)) : 0
#define RESERVE(x, sz) T(x) = ((x).alloc > S(x) + (sz) \
? T(x) \
View
0  discount-2.1.2/docheader.c → discount-2.1.5a/docheader.c
File renamed without changes
View
0  discount-2.1.2/dumptree.c → discount-2.1.5a/dumptree.c
File renamed without changes
View
0  discount-2.1.2/emmatch.c → discount-2.1.5a/emmatch.c
File renamed without changes
View
1  discount-2.1.2/flags.c → discount-2.1.5a/flags.c
@@ -29,6 +29,7 @@ static struct flagnames flagnames[] = {
{ MKD_NOALPHALIST, "!ALPHALIST" },
{ MKD_NODLIST, "!DLIST" },
{ MKD_EXTRA_FOOTNOTE, "FOOTNOTE" },
+ { MKD_NOSTYLE, "!STYLE" },
};
#define NR(x) (sizeof x/sizeof x[0])
View
129 discount-2.1.2/generate.c → discount-2.1.5a/generate.c
@@ -183,9 +183,10 @@ Qem(MMIOT *f, char c, int count)
/* generate html from a markup fragment
*/
void
-___mkd_reparse(char *bfr, int size, int flags, MMIOT *f)
+___mkd_reparse(char *bfr, int size, int flags, MMIOT *f, char *esc)
{
MMIOT sub;
+ struct escaped e;
___mkd_initmmiot(&sub, f->footnotes);
@@ -193,6 +194,14 @@ ___mkd_reparse(char *bfr, int size, int flags, MMIOT *f)
sub.cb = f->cb;
sub.ref_prefix = f->ref_prefix;
+ if ( esc ) {
+ sub.esc = &e;
+ e.up = f->esc;
+ e.text = esc;
+ }
+ else
+ sub.esc = f->esc;
+
push(bfr, size, &sub);
EXPAND(sub.in) = 0;
S(sub.in)--;
@@ -207,6 +216,23 @@ ___mkd_reparse(char *bfr, int size, int flags, MMIOT *f)
/*
+ * check the escape list for special cases
+ */
+static int
+escaped(MMIOT *f, char c)
+{
+ struct escaped *thing = f->esc;
+
+ while ( thing ) {
+ if ( strchr(thing->text, c) )
+ return 1;
+ thing = thing->up;
+ }
+ return 0;
+}
+
+
+/*
* write out a url, escaping problematic characters
*/
static void
@@ -553,7 +579,7 @@ printlinkyref(MMIOT *f, linkytype *tag, char *link, int size)
puturl(link + tag->szpat, size - tag->szpat, f, 0);
}
else
- ___mkd_reparse(link + tag->szpat, size - tag->szpat, MKD_TAGTEXT, f);
+ ___mkd_reparse(link + tag->szpat, size - tag->szpat, MKD_TAGTEXT, f, 0);
Qstring(tag->link_sfx, f);
@@ -585,7 +611,7 @@ extra_linky(MMIOT *f, Cstring text, Footnote *ref)
return 0;
if ( f->flags & IS_LABEL )
- ___mkd_reparse(T(text), S(text), linkt.flags, f);
+ ___mkd_reparse(T(text), S(text), linkt.flags, f, 0);
else {
ref->flags |= REFERENCED;
ref->refnumber = ++ f->reference;
@@ -604,7 +630,8 @@ linkyformat(MMIOT *f, Cstring text, int image, Footnote *ref)
{
linkytype *tag;
- if ( image || (ref == 0) )
+
+ if ( image )
tag = &imaget;
else if ( tag = pseudo(ref->link) ) {
if ( f->flags & (MKD_NO_EXT|MKD_SAFELINK) )
@@ -624,7 +651,7 @@ linkyformat(MMIOT *f, Cstring text, int image, Footnote *ref)
return 0;
if ( f->flags & IS_LABEL )
- ___mkd_reparse(T(text), S(text), tag->flags, f);
+ ___mkd_reparse(T(text), S(text), tag->flags, f, 0);
else if ( tag->link_pfx ) {
printlinkyref(f, tag, T(ref->link), S(ref->link));
@@ -635,12 +662,12 @@ linkyformat(MMIOT *f, Cstring text, int image, Footnote *ref)
if ( S(ref->title) ) {
Qstring(" title=\"", f);
- ___mkd_reparse(T(ref->title), S(ref->title), MKD_TAGTEXT, f);
+ ___mkd_reparse(T(ref->title), S(ref->title), MKD_TAGTEXT, f, 0);
Qchar('"', f);
}
Qstring(tag->text_pfx, f);
- ___mkd_reparse(T(text), S(text), tag->flags, f);
+ ___mkd_reparse(T(text), S(text), tag->flags, f, 0);
Qstring(tag->text_sfx, f);
}
else
@@ -707,8 +734,6 @@ linkylinky(int image, MMIOT *f)
else
status = linkyformat(f, name, image, ref);
}
- else if ( f->flags & IS_LABEL )
- status = linkyformat(f, name, image, 0);
}
}
}
@@ -810,6 +835,8 @@ code(MMIOT *f, char *s, int length)
for ( i=0; i < length; i++ )
if ( (c = s[i]) == 003) /* ^C: expand back to 2 spaces */
Qstring(" ", f);
+ else if ( c == '\\' && (i < length-1) && escaped(f, s[i+1]) )
+ cputc(s[++i], f);
else
cputc(c, f);
} /* code */
@@ -821,7 +848,7 @@ static void
delspan(MMIOT *f, int size)
{
Qstring("<del>", f);
- ___mkd_reparse(cursor(f)-1, size, 0, f);
+ ___mkd_reparse(cursor(f)-1, size, 0, f, 0);
Qstring("</del>", f);
}
@@ -1058,7 +1085,7 @@ islike(MMIOT *f, char *s)
int len;
int i;
- if ( s[0] == '<' ) {
+ if ( s[0] == '|' ) {
if ( !isthisnonword(f, -1) )
return 0;
++s;
@@ -1067,7 +1094,7 @@ islike(MMIOT *f, char *s)
if ( !(len = strlen(s)) )
return 0;
- if ( s[len-1] == '>' ) {
+ if ( s[len-1] == '|' ) {
if ( !isthisnonword(f,len-1) )
return 0;
len--;
@@ -1086,13 +1113,13 @@ static struct smarties {
char *entity;
int shift;
} smarties[] = {
- { '\'', "'s>", "rsquo", 0 },
- { '\'', "'t>", "rsquo", 0 },
- { '\'', "'re>", "rsquo", 0 },
- { '\'', "'ll>", "rsquo", 0 },
- { '\'', "'ve>", "rsquo", 0 },
- { '\'', "'m>", "rsquo", 0 },
- { '\'', "'d>", "rsquo", 0 },
+ { '\'', "'s|", "rsquo", 0 },
+ { '\'', "'t|", "rsquo", 0 },
+ { '\'', "'re|", "rsquo", 0 },
+ { '\'', "'ll|", "rsquo", 0 },
+ { '\'', "'ve|", "rsquo", 0 },
+ { '\'', "'m|", "rsquo", 0 },
+ { '\'', "'d|", "rsquo", 0 },
{ '-', "---", "mdash", 2 },
{ '-', "--", "ndash", 1 },
{ '.', "...", "hellip", 2 },
@@ -1100,11 +1127,11 @@ static struct smarties {
{ '(', "(c)", "copy", 2 },
{ '(', "(r)", "reg", 2 },
{ '(', "(tm)", "trade", 3 },
- { '3', "<3/4>", "frac34", 2 },
- { '3', "<3/4ths>", "frac34", 2 },
- { '1', "<1/2>", "frac12", 2 },
- { '1', "<1/4>", "frac14", 2 },
- { '1', "<1/4th>", "frac14", 2 },
+ { '3', "|3/4|", "frac34", 2 },
+ { '3', "|3/4ths|", "frac34", 2 },
+ { '1', "|1/2|", "frac12", 2 },
+ { '1', "|1/4|", "frac14", 2 },
+ { '1', "|1/4th|", "frac14", 2 },
{ '&', "&#0;", 0, 3 },
} ;
#define NRSMART ( sizeof smarties / sizeof smarties[0] )
@@ -1146,7 +1173,7 @@ smartypants(int c, int *flags, MMIOT *f)
break;
else if ( c == '\'' && peek(f, j+1) == '\'' ) {
Qstring("&ldquo;", f);
- ___mkd_reparse(cursor(f)+1, j-2, 0, f);
+ ___mkd_reparse(cursor(f)+1, j-2, 0, f, 0);
Qstring("&rdquo;", f);
shift(f,j+1);
return 1;
@@ -1268,7 +1295,7 @@ text(MMIOT *f)
shift(f,len);
}
Qstring("<sup>",f);
- ___mkd_reparse(sup, len, 0, f);
+ ___mkd_reparse(sup, len, 0, f, "()");
Qstring("</sup>", f);
}
break;
@@ -1327,16 +1354,16 @@ text(MMIOT *f)
Qchar(c, f);
break;
- case '>': case '#': case '.': case '-':
- case '+': case '{': case '}': case ']':
- case '!': case '[': case '*': case '_':
- case '\\':case '(': case ')':
- case '`': Qchar(c, f);
+ case EOF: Qchar('\\', f);
break;
- default:
- Qchar('\\', f);
- if ( c != EOF )
- shift(f,-1);
+
+ default: if ( escaped(f,c) ||
+ strchr(">#.-+{}]![*_\\()`", c) )
+ Qchar(c, f);
+ else {
+ Qchar('\\', f);
+ shift(f, -1);
+ }
break;
}
break;
@@ -1403,14 +1430,13 @@ static char* alignments[] = { "", " align=\"center\"", " align=\"left\"",
typedef STRING(int) Istring;
static int
-splat(Line *p, int leading_pipe, char *block, Istring align, int force, MMIOT *f)
+splat(Line *p, char *block, Istring align, int force, MMIOT *f)
{
int first,
idx = p->dle,
colno = 0;
- if ( leading_pipe ) idx++;
___mkd_tidy(&p->text);
if ( T(p->text)[S(p->text)-1] == '|' )
--S(p->text);
@@ -1430,7 +1456,7 @@ splat(Line *p, int leading_pipe, char *block, Istring align, int force, MMIOT *f
Qprintf(f, "<%s%s>",
block,
alignments[ (colno < S(align)) ? T(align)[colno] : a_NONE ]);
- ___mkd_reparse(T(p->text)+first, idx-first, 0, f);
+ ___mkd_reparse(T(p->text)+first, idx-first, 0, f, "|");
Qprintf(f, "</%s>\n", block);
idx++;
colno++;
@@ -1452,20 +1478,27 @@ printtable(Paragraph *pp, MMIOT *f)
Line *hdr, *dash, *body;
Istring align;
- int hcols,start,starts_with_pipe=0;
+ int hcols,start;
char *p;
+ enum e_alignments it;
hdr = pp->text;
dash= hdr->next;
body= dash->next;
- starts_with_pipe = T(hdr->text)[hdr->dle] == '|';
+ if ( T(hdr->text)[hdr->dle] == '|' ) {
+ /* trim leading pipe off all lines
+ */
+ Line *r;
+ for ( r = pp->text; r; r = r->next )
+ r->dle ++;
+ }
- /* first figure out cell alignments */
+ /* figure out cell alignments */
CREATE(align);
- for (p=T(dash->text), start=0; start < S(dash->text); ) {
+ for (p=T(dash->text), start=dash->dle; start < S(dash->text); ) {
char first, last;
int end;
@@ -1478,14 +1511,16 @@ printtable(Paragraph *pp, MMIOT *f)
last = p[end];
}
}
- EXPAND(align) = ( first == ':' ) ? (( last == ':') ? a_CENTER : a_LEFT)
- : (( last == ':') ? a_RIGHT : a_NONE );
+ it = ( first == ':' ) ? (( last == ':') ? a_CENTER : a_LEFT)
+ : (( last == ':') ? a_RIGHT : a_NONE );
+
+ EXPAND(align) = it;
start = 1+end;
}
Qstring("<table>\n", f);
Qstring("<thead>\n", f);
- hcols = splat(hdr, starts_with_pipe, "th", align, 0, f);
+ hcols = splat(hdr, "th", align, 0, f);
Qstring("</thead>\n", f);
if ( hcols < S(align) )
@@ -1496,7 +1531,7 @@ printtable(Paragraph *pp, MMIOT *f)
Qstring("<tbody>\n", f);
for ( ; body; body = body->next)
- splat(body, starts_with_pipe, "td", align, 1, f);
+ splat(body, "td", align, 1, f);
Qstring("</tbody>\n", f);
Qstring("</table>\n", f);
@@ -1605,7 +1640,7 @@ definitionlist(Paragraph *p, MMIOT *f)
for ( ; p ; p = p->next) {
for ( tag = p->text; tag; tag = tag->next ) {
Qstring("<dt>", f);
- ___mkd_reparse(T(tag->text), S(tag->text), 0, f);
+ ___mkd_reparse(T(tag->text), S(tag->text), 0, f, 0);
Qstring("</dt>\n", f);
}
View
100 discount-2.1.5a/github_flavoured.c
@@ -0,0 +1,100 @@
+
+/*
+ * github_flavoured -- implement the obnoxious "returns are hard newlines"
+ * feature in github flavoured markdown.
+ *
+ * Copyright (C) 2012 David L Parsons.
+ * The redistribution terms are provided in the COPYRIGHT file that must
+ * be distributed with this source code.
+ */
+#include "config.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <ctype.h>
+
+#include "cstring.h"
+#include "markdown.h"
+#include "amalloc.h"
+
+/* build a Document from any old input.
+ */
+typedef int (*getc_func)(void*);
+
+Document *
+gfm_populate(getc_func getc, void* ctx, int flags)
+{
+ Cstring line;
+ Document *a = __mkd_new_Document();
+ int c;
+ int pandoc = 0;
+
+ if ( !a ) return 0;
+
+ a->tabstop = (flags & MKD_TABSTOP) ? 4 : TABSTOP;
+
+ CREATE(line);
+
+ while ( (c = (*getc)(ctx)) != EOF ) {
+ if ( c == '\n' ) {
+ if ( pandoc != EOF && pandoc < 3 ) {
+ if ( S(line) && (T(line)[0] == '%') )
+ pandoc++;
+ else
+ pandoc = EOF;
+ }
+
+ if (pandoc == EOF) {
+ EXPAND(line) = ' ';
+ EXPAND(line) = ' ';
+ }
+ __mkd_enqueue(a, &line);
+ S(line) = 0;
+ }
+ else if ( isprint(c) || isspace(c) || (c & 0x80) )
+ EXPAND(line) = c;
+ }
+
+ if ( S(line) )
+ __mkd_enqueue(a, &line);
+
+ DELETE(line);
+
+ if ( (pandoc == 3) && !(flags & (MKD_NOHEADER|MKD_STRICT)) ) {
+ /* the first three lines started with %, so we have a header.
+ * clip the first three lines out of content and hang them
+ * off header.
+ */
+ Line *headers = T(a->content);
+
+ a->title = headers; __mkd_header_dle(a->title);
+ a->author= headers->next; __mkd_header_dle(a->author);
+ a->date = headers->next->next; __mkd_header_dle(a->date);
+
+ T(a->content) = headers->next->next->next;
+ }
+
+ return a;
+}
+
+
+/* convert a block of text into a linked list
+ */
+Document *
+gfm_string(const char *buf, int len, DWORD flags)
+{
+ struct string_stream about;
+
+ about.data = buf;
+ about.size = len;
+
+ return gfm_populate((getc_func)__mkd_io_strget, &about, flags & INPUT_MASK);
+}
+
+
+/* convert a file into a linked list
+ */
+Document *
+gfm_in(FILE *f, DWORD flags)
+{
+ return gfm_populate((getc_func)fgetc, f, flags & INPUT_MASK);
+}
View
0  discount-2.1.2/html5.c → discount-2.1.5a/html5.c
File renamed without changes
View
31 discount-2.1.2/main.c → discount-2.1.5a/main.c
@@ -18,6 +18,7 @@
#include "config.h"
#include "amalloc.h"
#include "pgm_options.h"
+#include "tags.h"
#if HAVE_LIBGEN_H
#include <libgen.h>
@@ -59,7 +60,6 @@ complain(char *fmt, ...)
}
-float
main(int argc, char **argv)
{
int opt;
@@ -67,9 +67,12 @@ main(int argc, char **argv)
mkd_flag_t flags = 0;
int debug = 0;
int toc = 0;
+ int content = 1;
int version = 0;
int with_html5 = 0;
+ int styles = 0;
int use_mkd_line = 0;
+ int github_flavoured = 0;
char *extra_footnote_prefix = 0;
char *urlflags = 0;
char *text = 0;
@@ -84,7 +87,7 @@ main(int argc, char **argv)
pgm = basename(argv[0]);
opterr = 1;
- while ( (opt=getopt(argc, argv, "5b:C:df:E:F:o:s:t:TV")) != EOF ) {
+ while ( (opt=getopt(argc, argv, "5b:C:df:E:F:Gno:s:St:TV")) != EOF ) {
switch (opt) {
case '5': with_html5 = 1;
break;
@@ -110,13 +113,19 @@ main(int argc, char **argv)
else if ( !set_flag(&flags, optarg) )
complain("unknown option <%s>", optarg);
break;
+ case 'G': github_flavoured = 1;
+ break;
+ case 'n': content = 0;
+ break;
+ case 's': text = optarg;
+ break;
+ case 'S': styles = 1;
+ break;
case 't': text = optarg;
use_mkd_line = 1;
break;
case 'T': toc = 1;
break;
- case 's': text = optarg;
- break;
case 'C': extra_footnote_prefix = optarg;
break;
case 'o': if ( ofile ) {
@@ -155,7 +164,10 @@ main(int argc, char **argv)
rc = mkd_generateline( text, strlen(text), stdout, flags);
else {
if ( text ) {
- if ( (doc = mkd_string(text, strlen(text), flags)) == 0 ) {
+ doc = github_flavoured ? gfm_string(text, strlen(text), flags)
+ : mkd_string(text, strlen(text), flags) ;
+
+ if ( !doc ) {
perror(text);
exit(1);
}
@@ -165,7 +177,9 @@ main(int argc, char **argv)
perror(argv[0]);
exit(1);
}
- if ( (doc = mkd_in(stdin,flags)) == 0 ) {
+
+ doc = github_flavoured ? gfm_in(stdin,flags) : mkd_in(stdin,flags);
+ if ( !doc ) {
perror(argc ? argv[0] : "stdin");
exit(1);
}
@@ -185,9 +199,12 @@ main(int argc, char **argv)
rc = 1;
if ( mkd_compile(doc, flags) ) {
rc = 0;
+ if ( styles )
+ mkd_generatecss(doc, stdout);
if ( toc )
mkd_generatetoc(doc, stdout);
- mkd_generatehtml(doc, stdout);
+ if ( content )
+ mkd_generatehtml(doc, stdout);
mkd_cleanup(doc);
}
}
View
0  discount-2.1.2/makepage.1 → discount-2.1.5a/makepage.1
File renamed without changes
View
1  discount-2.1.2/makepage.c → discount-2.1.5a/makepage.c
@@ -22,7 +22,6 @@ basename(char *p)
char *pgm = "makepage";
-float
main(argc, argv)
int argc;
char **argv;
View
14 discount-2.1.2/markdown.1 → discount-2.1.5a/markdown.1
@@ -15,7 +15,9 @@
.Op Fl C Ar prefix
.Op Fl F Pa bitmap
.Op Fl f Ar flags
+.Op Fl n
.Op Fl o Pa file
+.Op Fl S
.Op Fl s Pa text
.Op Fl t Pa text
.Op Pa textfile
@@ -107,6 +109,8 @@ Allow alphabetic lists.
Allow definition lists.
.It Ar footnote
Allow markdown extra-style footnotes.
+.It Ar styles
+Extract <style> blocks from the output.
.El
.Pp
As an example, the option
@@ -123,6 +127,13 @@ described in
.Xr markdown 3
(the flag values are defined in
.Pa mkdio.h )
+.It Fl n
+Don't write generated html.
+.It Fl o Pa file
+Write the generated html to
+.Pa file .
+.It Fl S
+output <style> blocks.
.It Fl V
Show the version# and compile-time configuration data.
.Pp
@@ -138,9 +149,6 @@ was configured to use the specified tabstop.
.It Fl VV
Show the version#, the compile-time configuration, and the
run-time configuration.
-.It Fl o Pa file
-Write the generated html to
-.Pa file .
.It Fl t Ar text
Use
.Xr mkd_text 3
View
0  discount-2.1.2/markdown.3 → discount-2.1.5a/markdown.3
File renamed without changes
View
0  discount-2.1.2/markdown.7 → discount-2.1.5a/markdown.7
File renamed without changes
View
42 discount-2.1.2/markdown.c → discount-2.1.5a/markdown.c
@@ -188,7 +188,8 @@ checkline(Line *l)
int eol, i;
int dashes = 0, spaces = 0,
equals = 0, underscores = 0,
- stars = 0, tildes = 0;
+ stars = 0, tildes = 0,
+ backticks = 0;
l->flags |= CHECKED;
l->kind = chk_text;
@@ -210,12 +211,15 @@ checkline(Line *l)
case '=': equals = 1; break;
case '_': underscores = 1; break;
case '*': stars = 1; break;
+#if WITH_FENCED_CODE
case '~': tildes = 1; break;
+ case '`': backticks = 1; break;
+#endif
default: return;
}
}
- if ( dashes + equals + underscores + stars + tildes > 1 )
+ if ( dashes + equals + underscores + stars + tildes + backticks > 1 )
return;
if ( spaces ) {
@@ -226,8 +230,11 @@ checkline(Line *l)
if ( stars || underscores ) { l->kind = chk_hr; }
else if ( dashes ) { l->kind = chk_dash; }
- else if ( tildes ) { l->kind = chk_tilde; }
else if ( equals ) { l->kind = chk_equal; }
+#if WITH_FENCED_CODE
+ else if ( tildes ) { l->kind = chk_tilde; }
+ else if ( backticks ) { l->kind = chk_backtick; }
+#endif
}
@@ -449,7 +456,7 @@ is_extra_dt(Line *t, int *clip)
{
#if USE_EXTRA_DL
- if ( t && t->next && T(t->text)[0] != '='
+ if ( t && t->next && S(t->text) && T(t->text)[0] != '='
&& T(t->text)[S(t->text)-1] != '=') {
Line *x;
@@ -599,12 +606,15 @@ codeblock(Paragraph *p)
#ifdef WITH_FENCED_CODE
static int
-iscodefence(Line *r, int size)
+iscodefence(Line *r, int size, line_type kind)
{
if ( !(r->flags & CHECKED) )
checkline(r);
- return (r->kind == chk_tilde) && (r->count >= size);
+ if ( kind )
+ return (r->kind == kind) && (r->count >= size);
+ else
+ return (r->kind == chk_tilde || r->kind == chk_backtick) && (r->count >= size);
}
static Paragraph *
@@ -617,14 +627,14 @@ fencedcodeblock(ParagraphRoot *d, Line **ptr)
/* don't allow zero-length code fences
*/
- if ( (first->next == 0) || iscodefence(first->next, first->count) )
+ if ( (first->next == 0) || iscodefence(first->next, first->count, 0) )
return 0;
/* find the closing fence, discard the fences,
* return a Paragraph with the contents
*/
for ( r = first; r && r->next; r = r->next )
- if ( iscodefence(r->next, first->count) ) {
+ if ( iscodefence(r->next, first->count, first->kind) ) {
(*ptr) = r->next->next;
ret = Pp(d, first->next, CODE);
___mkd_freeLine(first);
@@ -872,7 +882,7 @@ definition_block(Paragraph *top, int clip, MMIOT *f, int kind)
if ( (text = skipempty(q->next)) == 0 )
break;
- if (( para = (text != q->next) ))
+ if ( para = (text != q->next) )
___mkd_freeLineRange(q, text);
q->next = 0;
@@ -895,7 +905,7 @@ definition_block(Paragraph *top, int clip, MMIOT *f, int kind)
if ( (q = skipempty(text)) == 0 )
break;
- if (( para = (q != text) )) {
+ if ( para = (q != text) ) {
Line anchor;
anchor.next = text;
@@ -1085,6 +1095,7 @@ compile_document(Line *ptr, MMIOT *f)
while ( ptr ) {
if ( !(f->flags & MKD_NOHTML) && (tag = isopentag(ptr)) ) {
+ int blocktype;
/* If we encounter a html/style block, compile and save all
* of the cached source BEFORE processing the html/style.
*/
@@ -1094,7 +1105,12 @@ compile_document(Line *ptr, MMIOT *f)
p->down = compile(T(source), 1, f);
T(source) = E(source) = 0;
}
- p = Pp(&d, ptr, strcmp(tag->id, "STYLE") == 0 ? STYLE : HTML);
+
+ if ( f->flags & MKD_NOSTYLE )
+ blocktype = HTML;
+ else
+ blocktype = strcmp(tag->id, "STYLE") == 0 ? STYLE : HTML;
+ p = Pp(&d, ptr, blocktype);
ptr = htmlblock(p, tag, &unclosed);
if ( unclosed ) {
p->typ = SOURCE;
@@ -1212,7 +1228,7 @@ compile(Line *ptr, int toplevel, MMIOT *f)
ptr = codeblock(p);
}
#if WITH_FENCED_CODE
- else if ( iscodefence(ptr,3) && (p=fencedcodeblock(&d, &ptr)) )
+ else if ( iscodefence(ptr,3,0) && (p=fencedcodeblock(&d, &ptr)) )
/* yay, it's already done */ ;
#endif
else if ( ishr(ptr) ) {
@@ -1221,7 +1237,7 @@ compile(Line *ptr, int toplevel, MMIOT *f)
ptr = ptr->next;
___mkd_freeLine(r);
}
- else if (( list_class = islist(ptr, &indent, f->flags, &list_type) )) {
+ else if ( list_class = islist(ptr, &indent, f->flags, &list_type) ) {
if ( list_class == DL ) {
p = Pp(&d, ptr, DL);
ptr = definition_block(p, indent, f, list_type);
View
37 discount-2.1.2/markdown.h → discount-2.1.5a/markdown.h
@@ -23,6 +23,10 @@ typedef struct footnote {
* that all tabs will be expanded to spaces!], and a pointer to
* the next line.
*/
+typedef enum { chk_text, chk_code,
+ chk_hr, chk_dash,
+ chk_tilde, chk_backtick,
+ chk_equal } line_type;
typedef struct line {
Cstring text;
struct line *next;
@@ -31,9 +35,7 @@ typedef struct line {
#define PIPECHAR 0x01 /* line contains a | */
#define CHECKED 0x02
- enum { chk_text, chk_code,
- chk_hr, chk_dash,
- chk_tilde, chk_equal } kind;
+ line_type kind;
int count;
} Line;
@@ -79,6 +81,12 @@ typedef struct callback_data {
} Callback_data;
+struct escaped {
+ char *text;
+ struct escaped *up;
+} ;
+
+
/* a magic markdown io thing holds all the data structures needed to
* do the backend processing of a markdown document
*/
@@ -88,6 +96,7 @@ typedef struct mmiot {
Qblock Q;
int isp;
int reference;
+ struct escaped *esc;
char *ref_prefix;
STRING(Footnote) *footnotes;
DWORD flags;
@@ -113,6 +122,7 @@ typedef struct mmiot {
#define MKD_NOALPHALIST 0x00080000
#define MKD_NODLIST 0x00100000
#define MKD_EXTRA_FOOTNOTE 0x00200000
+#define MKD_NOSTYLE 0x00400000
#define IS_LABEL 0x08000000
#define USER_FLAGS 0x0FFFFFFF
#define INPUT_MASK (MKD_NOHEADER|MKD_TABSTOP)
@@ -145,6 +155,16 @@ typedef struct document {
} Document;
+/*
+ * economy FILE-type structure for pulling characters out of a
+ * fixed-length string.
+ */
+struct string_stream {
+ const char *data; /* the unread data */
+ int size; /* and how much is there? */
+} ;
+
+
extern int mkd_firstnonblank(Line *);
extern int mkd_compile(Document *, DWORD);
extern int mkd_document(Document *, char **);
@@ -166,6 +186,9 @@ extern void mkd_string_to_anchor(char*,int, mkd_sta_function_t, void*, int);
extern Document *mkd_in(FILE *, DWORD);
extern Document *mkd_string(const char*,int, DWORD);
+extern Document *gfm_in(FILE *, DWORD);
+extern Document *gfm_string(const char*,int, DWORD);
+
extern void mkd_initialize();
extern void mkd_shlib_destructor();
@@ -182,8 +205,14 @@ extern void ___mkd_initmmiot(MMIOT *, void *);
extern void ___mkd_freemmiot(MMIOT *, void *);
extern void ___mkd_freeLineRange(Line *, Line *);
extern void ___mkd_xml(char *, int, FILE *);
-extern void ___mkd_reparse(char *, int, int, MMIOT*);
+extern void ___mkd_reparse(char *, int, int, MMIOT*, char*);
extern void ___mkd_emblock(MMIOT*);
extern void ___mkd_tidy(Cstring *);
+extern Document *__mkd_new_Document();
+extern void __mkd_enqueue(Document*, Cstring *);
+extern void __mkd_header_dle(Line *);
+
+extern int __mkd_io_strget(struct string_stream *);
+
#endif/*_MARKDOWN_D*/
View
0  discount-2.1.2/mkd-callbacks.3 → discount-2.1.5a/mkd-callbacks.3
File renamed without changes
View
0  discount-2.1.2/mkd-extensions.7 → discount-2.1.5a/mkd-extensions.7
File renamed without changes
View
0  discount-2.1.2/mkd-functions.3 → discount-2.1.5a/mkd-functions.3
File renamed without changes
View
0  discount-2.1.2/mkd-line.3 → discount-2.1.5a/mkd-line.3
File renamed without changes
View
0  discount-2.1.2/mkd2html.1 → discount-2.1.5a/mkd2html.1
File renamed without changes
View
28 discount-2.1.2/mkd2html.c → discount-2.1.5a/mkd2html.c
@@ -45,7 +45,7 @@ basename(char *path)
{
char *p;
- if (( p = strrchr(path, '/') ))
+ if ( p = strrchr(path, '/') )
return 1+p;
return path;
}
@@ -65,7 +65,6 @@ fail(char *why, ...)
}
-void
main(argc, argv)
char **argv;
{
@@ -82,7 +81,7 @@ char **argv;
CREATE(footers);
pgm = basename(argv[0]);
- while ( argc > 2 ) {
+ while ( argc ) {
if ( strcmp(argv[1], "-css") == 0 ) {
EXPAND(css) = argv[2];
argc -= 2;
@@ -98,14 +97,20 @@ char **argv;
argc -= 2;
argv += 2;
}
+ else
+ break;
}
-
- if ( argc > 1 ) {
+ switch ( argc ) {
char *p, *dot;
-
+ case 1:
+ input = stdin;
+ output = stdout;
+ break;
+ case 2:
+ case 3:
+ dest = malloc(strlen(argv[argc-1]) + 6);
source = malloc(strlen(argv[1]) + 6);
- dest = malloc(strlen(argv[1]) + 6);
if ( !(source && dest) )
fail("out of memory allocating name buffers");
@@ -129,10 +134,11 @@ char **argv;
if ( (output = fopen(dest, "w")) == 0 )
fail("can't write to %s", dest);
- }
- else {
- input = stdin;
- output = stdout;
+ break;
+
+ default:
+ fprintf(stderr, "usage: %s [opts] source [dest]\n", pgm);
+ exit(1);
}
if ( (mmiot = mkd_in(input, 0)) == 0 )
View
42 discount-2.1.2/mkdio.c → discount-2.1.5a/mkdio.c
@@ -18,13 +18,13 @@ typedef ANCHOR(Line) LineAnchor;
/* create a new blank Document
*/
-static Document*
-new_Document()
+Document*
+__mkd_new_Document()
{
Document *ret = calloc(sizeof(Document), 1);
if ( ret ) {
- if (( ret->ctx = calloc(sizeof(MMIOT), 1) )) {
+ if ( ret->ctx = calloc(sizeof(MMIOT), 1) ) {
ret->magic = VALID_DOCUMENT;
return ret;
}
@@ -37,8 +37,8 @@ new_Document()
/* add a line to the markdown input chain, expanding tabs and
* noting the presence of special characters as we go.
*/
-static void
-queue(Document* a, Cstring *line)
+void
+__mkd_enqueue(Document* a, Cstring *line)
{
Line *p = calloc(sizeof *p, 1);
unsigned char c;
@@ -75,8 +75,8 @@ queue(Document* a, Cstring *line)
/* trim leading blanks from a header line
*/
-static void
-header_dle(Line *p)
+void
+__mkd_header_dle(Line *p)
{
CLIP(p->text, 0, 1);
p->dle = mkd_firstnonblank(p);
@@ -91,7 +91,7 @@ Document *
populate(getc_func getc, void* ctx, int flags)
{
Cstring line;
- Document *a = new_Document();
+ Document *a = __mkd_new_Document();
int c;
int pandoc = 0;
@@ -109,7 +109,7 @@ populate(getc_func getc, void* ctx, int flags)
else
pandoc = EOF;
}
- queue(a, &line);
+ __mkd_enqueue(a, &line);
S(line) = 0;
}
else if ( isprint(c) || isspace(c) || (c & 0x80) )
@@ -117,7 +117,7 @@ populate(getc_func getc, void* ctx, int flags)
}
if ( S(line) )
- queue(a, &line);
+ __mkd_enqueue(a, &line);
DELETE(line);
@@ -128,9 +128,9 @@ populate(getc_func getc, void* ctx, int flags)
*/
Line *headers = T(a->content);
- a->title = headers; header_dle(a->title);
- a->author= headers->next; header_dle(a->author);
- a->date = headers->next->next; header_dle(a->date);
+ a->title = headers; __mkd_header_dle(a->title);
+ a->author= headers->next; __mkd_header_dle(a->author);
+ a->date = headers->next->next; __mkd_header_dle(a->date);
T(a->content) = headers->next->next->next;
}
@@ -150,14 +150,8 @@ mkd_in(FILE *f, DWORD flags)
/* return a single character out of a buffer
*/
-struct string_ctx {
- const char *data; /* the unread data */
- int size; /* and how much is there? */
-} ;
-
-
-static int
-strget(struct string_ctx *in)
+int
+__mkd_io_strget(struct string_stream *in)
{
if ( !in->size ) return EOF;
@@ -172,12 +166,12 @@ strget(struct string_ctx *in)
Document *
mkd_string(const char *buf, int len, DWORD flags)
{
- struct string_ctx about;
+ struct string_stream about;
about.data = buf;
about.size = len;
- return populate((getc_func)strget, &about, flags & INPUT_MASK);
+ return populate((getc_func)__mkd_io_strget, &about, flags & INPUT_MASK);
}
@@ -254,7 +248,7 @@ mkd_parse_line(char *bfr, int size, MMIOT *f, int flags)
{
___mkd_initmmiot(f, 0);
f->flags = flags & USER_FLAGS;
- ___mkd_reparse(bfr, size, 0, f);
+ ___mkd_reparse(bfr, size, 0, f, 0);
___mkd_emblock(f);
}
View
6 discount-2.1.2/mkdio.h.in → discount-2.1.5a/mkdio.h.in
@@ -12,6 +12,11 @@ typedef @DWORD@ mkd_flag_t;
MMIOT *mkd_in(FILE*,mkd_flag_t); /* assemble input from a file */
MMIOT *mkd_string(const char*,int,mkd_flag_t); /* assemble input from a buffer */
+/* line builder for github flavoured markdown
+ */
+MMIOT *gfm_in(FILE*,mkd_flag_t); /* assemble input from a file */
+MMIOT *gfm_string(const char*,int,mkd_flag_t); /* assemble input from a buffer */
+
void mkd_basename(MMIOT*,char*);
void mkd_initialize();
@@ -100,6 +105,7 @@ void mkd_ref_prefix(MMIOT*, char*);
#define MKD_NOALPHALIST 0x00080000 /* forbid alphabetic lists */
#define MKD_NODLIST 0x00100000 /* forbid definition lists */
#define MKD_EXTRA_FOOTNOTE 0x00200000 /* enable markdown extra-style footnotes */
+#define MKD_NOSTYLE 0x00400000 /* don't extract <style> blocks */
#define MKD_EMBED MKD_NOLINKS|MKD_NOIMAGE|MKD_TAGTEXT
/* special flags for mkd_in() and mkd_string()
View
2  discount-2.1.2/mktags.c → discount-2.1.5a/mktags.c
@@ -41,7 +41,6 @@ typedef int (*stfu)(const void*,const void*);
/* load in the standard collection of html tags that markdown supports
*/
-int
main()
{
int i;
@@ -76,7 +75,6 @@ main()
KW("WBR");
KW("XMP");
SC("HR");
- SC("BR");
KW("IFRAME");
KW("MAP");
View
7 discount-2.1.2/pgm_options.c → discount-2.1.5a/pgm_options.c
@@ -54,11 +54,14 @@ static struct _opt {
{ "1.0", "markdown 1.0 compatibility", 0, 0, 1, MKD_1_COMPAT },
{ "footnotes", "markdown extra footnotes", 0, 0, 1, MKD_EXTRA_FOOTNOTE },
{ "footnote", "markdown extra footnotes", 0, 1, 1, MKD_EXTRA_FOOTNOTE },
+ { "style", "extract style blocks", 1, 0, 1, MKD_NOSTYLE },
} ;
#define NR(x) (sizeof x / sizeof x[0])
+typedef int (*stfu)(const void *, const void *);
+