This commit is contained in:
2026-01-25 02:47:47 +01:00
parent 8c1a721c4c
commit 957e3a4762
74 changed files with 7749 additions and 292 deletions
+21
View File
@@ -0,0 +1,21 @@
// retoor <retoor@molodetz.nl>
import "markdown" for Markdown
var multi = Markdown.toHtml("[First](http://a.com) and [Second](http://b.com)")
System.print(multi.contains("<a href=\"http://a.com\">First</a>")) // expect: true
System.print(multi.contains("<a href=\"http://b.com\">Second</a>")) // expect: true
var withPath = Markdown.toHtml("[Docs](/docs/api/index.html)")
System.print(withPath.contains("<a href=\"/docs/api/index.html\">Docs</a>")) // expect: true
var imgAlt = Markdown.toHtml("![A cat](cat.jpg)")
System.print(imgAlt.contains("<img src=\"cat.jpg\" alt=\"A cat\">")) // expect: true
var imgUrl = Markdown.toHtml("![Logo](https://example.com/logo.png)")
System.print(imgUrl.contains("<img src=\"https://example.com/logo.png\" alt=\"Logo\">")) // expect: true
var textAround = Markdown.toHtml("Click [here](url) now")
System.print(textAround.contains("Click ")) // expect: true
System.print(textAround.contains("<a href=\"url\">here</a>")) // expect: true
System.print(textAround.contains(" now")) // expect: true