inline_links.unit 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. >>> double quotes for title
  2. links [are](http://foo.com "woo") awesome
  3. <<<
  4. <p>links <a href="http://foo.com" title="woo">are</a> awesome</p>
  5. >>> no title
  6. links [are](http://foo.com) awesome
  7. <<<
  8. <p>links <a href="http://foo.com">are</a> awesome</p>
  9. >>> can style link contents
  10. links [*are*](http://foo.com) awesome
  11. <<<
  12. <p>links <a href="http://foo.com"><em>are</em></a> awesome</p>
  13. >>> image inside link
  14. links [![](/are.png)](http://foo.com) awesome
  15. <<<
  16. <p>links <a href="http://foo.com"><img src="/are.png" alt="" /></a> awesome</p>
  17. >>> image with alt inside link
  18. links [![my alt](/are.png)](http://foo.com) awesome
  19. <<<
  20. <p>links <a href="http://foo.com"><img src="/are.png" alt="my alt" /></a> awesome</p>
  21. >>> image with title inside link
  22. links [![](/are.png "my title")](http://foo.com) awesome
  23. <<<
  24. <p>links <a href="http://foo.com"><img src="/are.png" alt="" title="my title" /></a> awesome</p>
  25. >>> no URL
  26. links [are]() awesome
  27. <<<
  28. <p>links <a href="">are</a> awesome</p>
  29. >>> URL wrapped in angle brackets
  30. links [are](<http://example.com>) awesome
  31. <<<
  32. <p>links <a href="http://example.com">are</a> awesome</p>
  33. >>> URL wrapped in angle brackets with a title; https://github.com/commonmark/CommonMark/issues/521
  34. links [are](<http://example.com> "title") awesome
  35. <<<
  36. <p>links <a href="http://example.com" title="title">are</a> awesome</p>
  37. >>> multi-line link
  38. links [are
  39. awesome](<http://example.com>).
  40. <<<
  41. <p>links <a href="http://example.com">are
  42. awesome</a>.</p>
  43. >>> multi-line link with a title
  44. links [are](http://foo.com
  45. "woo") awesome
  46. <<<
  47. <p>links <a href="http://foo.com" title="woo">are</a> awesome</p>
  48. >>> not a real link
  49. links [are] (http://foo.com) awesome
  50. <<<
  51. <p>links [are] (http://foo.com) awesome</p>
  52. >>> resolver link without a resolver
  53. links [are *awesome*]
  54. <<<
  55. <p>links [are <em>awesome</em>]</p>
  56. >>> links with escaped parens
  57. [a](\(yes-a-link)
  58. [a](\(yes-a-link\))
  59. [a](\\(not-a-link\))
  60. [a](\\(yes-a-link\)))
  61. <<<
  62. <p><a href="(yes-a-link">a</a>
  63. <a href="(yes-a-link)">a</a>
  64. [a](\(not-a-link))
  65. <a href="(yes-a-link))">a</a></p>
  66. >>> links with unbalanced parentheses
  67. [foo](link(1.png) (what?)
  68. <<<
  69. <p>[foo](link(1.png) (what?)</p>
  70. >>> not an inline link: the title's ending quote is escaped
  71. links [are](<http://example.com> "title\") awesome
  72. <<<
  73. <p>links [are](<a href="http://example.com">http://example.com</a> &quot;title&quot;) awesome</p>