Text::Markdown::Discount
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
970 B

  1. . tests/functions.sh
  2. title "markup peculiarities"
  3. rc=0
  4. MARKDOWN_FLAGS=
  5. try 'list followed by header .......... ' \
  6. "
  7. - AAA
  8. - BBB
  9. -" \
  10. '<ul>
  11. <li>AAA
  12. <h2>- BBB</h2></li>
  13. </ul>'
  14. try 'ul with mixed item prefixes' \
  15. '
  16. - A
  17. 1. B' \
  18. '<ul>
  19. <li>A</li>
  20. <li>B</li>
  21. </ul>'
  22. try 'ol with mixed item prefixes' \
  23. '
  24. 1. A
  25. - B
  26. ' \
  27. '<ol>
  28. <li>A</li>
  29. <li>B</li>
  30. </ol>'
  31. try 'nested lists and a header' \
  32. '- A list item
  33. That goes over multiple lines
  34. and paragraphs
  35. - Another list item
  36. + with a
  37. + sublist
  38. ## AND THEN A HEADER' \
  39. '<ul>
  40. <li><p>A list item
  41. That goes over multiple lines</p>
  42. <p> and paragraphs</p></li>
  43. <li><p>Another list item</p>
  44. <ul>
  45. <li>with a</li>
  46. <li>sublist</li>
  47. </ul>
  48. </li>
  49. </ul>
  50. <h2>AND THEN A HEADER</h2>'
  51. try 'forcing a <br/>' 'this
  52. is' '<p>this<br/>
  53. is</p>'
  54. try 'trimming single spaces' 'this ' '<p>this</p>'
  55. try -fnohtml 'markdown <br/> with -fnohtml' 'foo
  56. is' '<p>foo<br/>
  57. is</p>'
  58. summary $0
  59. exit $rc