@truto/truto-jsonata 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1459,6 +1459,43 @@ This is a **bold** statement.
|
|
|
1459
1459
|
|
|
1460
1460
|
</details>
|
|
1461
1461
|
|
|
1462
|
+
<details>
|
|
1463
|
+
<summary>convertMarkdownToHtml(markdownString)</summary>
|
|
1464
|
+
|
|
1465
|
+
Converts Markdown content to HTML format.
|
|
1466
|
+
|
|
1467
|
+
**Example:**
|
|
1468
|
+
|
|
1469
|
+
```javascript
|
|
1470
|
+
import trutoJsonata from '@truto/truto-jsonata';
|
|
1471
|
+
|
|
1472
|
+
// Define an Markdown string to convert
|
|
1473
|
+
const markdownContent = `
|
|
1474
|
+
# Welcome to Markdown
|
|
1475
|
+
This is a **bold** statement.
|
|
1476
|
+
- Item 1
|
|
1477
|
+
- Item 2
|
|
1478
|
+
`;
|
|
1479
|
+
|
|
1480
|
+
// Use convertMarkdownToHtml to transform Markdown into HTML
|
|
1481
|
+
const expression = trutoJsonata("$convertMarkdownToHtml(markdownContent)");
|
|
1482
|
+
expression.evaluate({ markdownContent }).then(result => { console.log(result); });
|
|
1483
|
+
|
|
1484
|
+
/*
|
|
1485
|
+
Output:
|
|
1486
|
+
|
|
1487
|
+
<h1>Welcome to Markdown</h1>
|
|
1488
|
+
<p>This is a <strong>bold</strong> statement.</p>
|
|
1489
|
+
<ul>
|
|
1490
|
+
<li>Item 1</li>
|
|
1491
|
+
<li>Item 2</li>
|
|
1492
|
+
</ul>
|
|
1493
|
+
|
|
1494
|
+
*/
|
|
1495
|
+
```
|
|
1496
|
+
|
|
1497
|
+
</details>
|
|
1498
|
+
|
|
1462
1499
|
---
|
|
1463
1500
|
|
|
1464
1501
|
### Array and Object Utilities (Lodash Enhancements)
|