feat: add merge_all_wren utility, strutil demo, and 7 new API manual pages
Add WrenFileReader class in apps/merge_all_wren.wren for recursive .wren file discovery and content printing. Introduce example/strutil_demo.wren demonstrating case conversion, hex encoding, SHA256 hashing, string repetition, padding, HTML/JSON escaping, and URL encoding/decoding. Create manual/api pages for argparse, dataset, html, markdown, uuid, wdantic, and web modules. Update manual/api/index.html sidebar and module count from 21 to 28, adding links and cards for the new modules.
This commit is contained in:
Vendored
+21
@@ -0,0 +1,21 @@
|
||||
// retoor <retoor@molodetz.nl>
|
||||
|
||||
import "markdown" for Markdown
|
||||
|
||||
var unsafe = Markdown.toHtml("<script>alert('xss')</script>")
|
||||
System.print(unsafe.contains("<script>")) // expect: true
|
||||
|
||||
var safe = Markdown.toHtml("<script>alert('xss')</script>", {"safeMode": true})
|
||||
System.print(safe.contains("<script>")) // expect: false
|
||||
System.print(safe.contains("<script>")) // expect: true
|
||||
|
||||
var safeCode = Markdown.toHtml("```\n<div>test</div>\n```", {"safeMode": true})
|
||||
System.print(safeCode.contains("<div>")) // expect: false
|
||||
System.print(safeCode.contains("<div>")) // expect: true
|
||||
|
||||
var safeInline = Markdown.toHtml("Text with <b>html</b> inside", {"safeMode": true})
|
||||
System.print(safeInline.contains("<b>")) // expect: false
|
||||
System.print(safeInline.contains("<b>")) // expect: true
|
||||
|
||||
var ampersand = Markdown.toHtml("A & B", {"safeMode": true})
|
||||
System.print(ampersand.contains("&")) // expect: true
|
||||
Reference in New Issue
Block a user