) or { panic(err) }
+ ```
+
+ ### Escape html in strings
+
+ ```v
+ const html = '
+
+
+
+
+
+ Your App Content!
+
+
+
+ '
+ ```
+
[94mconst[39m omega = [94m3[39m [90m// should be first[39m
[94mconst[39m alpha = [94m5[39m [90m// should be in the middle[39m
diff --git a/cmd/tools/vdoc/tests/testdata/output_formats/main.html b/cmd/tools/vdoc/tests/testdata/output_formats/main.html
index 3dcedb9e71af03..38813c787936db 100644
--- a/cmd/tools/vdoc/tests/testdata/output_formats/main.html
+++ b/cmd/tools/vdoc/tests/testdata/output_formats/main.html
@@ -57,7 +57,40 @@ Description
This is an example of a an .md file, used for adding more
sha256.sum, sha256.block_size)
signature_from_token := base64.url_decode(token_split[2])
return hmac.equal(signature_from_token, signature_mirror)
-}
+}
Other language specifiers
##
+std::map<std::string, int> my_map {
+ {'KEY_1', 0},
+ {'KEY_2', 10},
+};
+
+for (const auto &[key, value] : my_map) {
+ std::cout << key << ': ' << value << ', ';
+}
+std::cout << '\n';
doc1 := toml.parse_text(<string content>) or { panic(err) }
+doc2 := toml.parse_file(<file path>) or { panic(err) }
Escape html in strings
const html = '<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <style>
+ body {
+ background: linear-gradient(to right, #274060, #1B2845);
+ color: GhostWhite;
+ font-family: sans-serif;
+ text-align: center;
+ }
+ </style>
+ </head>
+ <body>
+ <h1>Your App Content!</h1>
+ <button onclick="callV()">Call V!</button>
+ </body>
+ <script>
+ async function callV() {
+ // Call a V function that takes an argument and returns a value.
+ const res = await window.my_v_func(\'Hello from JS!\');
+ console.log(res);
+ }
+ </script>
+</html>'
diff --git a/cmd/tools/vdoc/tests/testdata/output_formats/main.text b/cmd/tools/vdoc/tests/testdata/output_formats/main.text
index d36f21bfba4fb9..092472890685cf 100644
--- a/cmd/tools/vdoc/tests/testdata/output_formats/main.text
+++ b/cmd/tools/vdoc/tests/testdata/output_formats/main.text
@@ -80,6 +80,57 @@ module main
}
```
+ ### Other language specifiers
+
+ ```cpp
+ #include
+ #include