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.

27 lines
803 B

  1. . tests/functions.sh
  2. title 'Reddit-style automatic links'
  3. rc=0
  4. try -fautolink 'single link' \
  5. 'http://www.pell.portland.or.us/~orc/Code/discount' \
  6. '<p><a href="http://www.pell.portland.or.us/~orc/Code/discount">http://www.pell.portland.or.us/~orc/Code/discount</a></p>'
  7. try -fautolink '[!](http://a.com "http://b.com")' \
  8. '[!](http://a.com "http://b.com")' \
  9. '<p><a href="http://a.com" title="http://b.com">!</a></p>'
  10. try -fautolink 'link surrounded by text' \
  11. 'here http://it is?' \
  12. '<p>here <a href="http://it">http://it</a> is?</p>'
  13. try -fautolink 'naked @' '@' '<p>@</p>'
  14. try -fautolink 'parenthesised (url)' \
  15. '(http://here)' \
  16. '<p>(<a href="http://here">http://here</a>)</p>'
  17. try -fautolink 'token with trailing @' 'orc@' '<p>orc@</p>'
  18. summary $0
  19. exit $rc