@dmitryvim/form-builder 0.2.28 → 0.2.30

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 CHANGED
@@ -304,6 +304,7 @@ See [Integration Guide](docs/integration.md) for detailed setup instructions.
304
304
  - **File**: Single file upload with compact dropzone, tile preview, and type restrictions
305
305
  - **Files**: Multiple file upload with 80px tile grid, per-file upload progress, and drag-and-drop
306
306
  - **Container**: Nested containers with repeatable array support
307
+ - **Markdown**: Display-only text block rendered from markdown syntax (v0.2.30+); never included in form data output
307
308
 
308
309
  ### File Handling
309
310
 
@@ -821,6 +822,56 @@ An editable 2D grid with plain-text cells, cell merging, and full keyboard navig
821
822
  - Readonly mode renders a static `<table>`
822
823
  - Full i18n support (6 translation keys: `tableAddRow`, `tableAddColumn`, `tableRemoveRow`, `tableRemoveColumn`, `tableMergeCells`, `tableSplitCell`)
823
824
 
825
+ ### Markdown Element (v0.2.30+)
826
+
827
+ A display-only element that renders markdown as safe HTML. It never appears in `getFormData()` output.
828
+
829
+ **Schema:**
830
+
831
+ ```json
832
+ {
833
+ "type": "markdown",
834
+ "content": "# Welcome\n\nPlease fill in **all required fields** below.\n\nSee the [guidelines](https://example.com) for details."
835
+ }
836
+ ```
837
+
838
+ **With optional key and conditional visibility:**
839
+
840
+ ```json
841
+ {
842
+ "type": "markdown",
843
+ "key": "terms-note",
844
+ "content": "## Terms Apply\n\nBy submitting you agree to our [terms](https://example.com/terms).",
845
+ "enableIf": { "key": "agreed", "equals": "yes" }
846
+ }
847
+ ```
848
+
849
+ **Properties:**
850
+
851
+ | Property | Type | Required | Description |
852
+ | ----------- | -------- | -------- | -------------------------------------------------------- |
853
+ | `type` | `string` | Yes | Must be `"markdown"` |
854
+ | `content` | `string` | Yes | Markdown source text |
855
+ | `key` | `string` | No | Optional identifier; field never contributes to form data |
856
+ | `enableIf` | object | No | Conditional visibility (same as other field types) |
857
+
858
+ **Supported markdown syntax:**
859
+
860
+ - Headings: `# H1` through `###### H6`
861
+ - Emphasis: `**bold**`, `*italic*`, `~~strikethrough~~`
862
+ - Inline code: `` `code` ``
863
+ - Fenced code blocks: ` ```language ... ``` `
864
+ - Links: `[text](url)`
865
+ - Lists: ordered (`1.`) and unordered (`-`, `*`)
866
+ - Blockquotes: `> text`
867
+ - Horizontal rules: `---`
868
+
869
+ **XSS Protection:**
870
+
871
+ - Raw `<`, `>`, `&` characters in content are escaped before parsing — HTML tags in markdown source cannot render as DOM elements
872
+ - `javascript:`, `data:`, `vbscript:` href schemes are stripped from all links
873
+ - All rendered links get `target="_blank" rel="noopener noreferrer"`
874
+
824
875
  ## Documentation
825
876
 
826
877
  - **API Reference** - See above for core methods and theming