kempo-ui 0.4.6 → 0.4.8
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/CHANGELOG.md +11 -0
- package/dist/components/Markdown.js +1 -0
- package/dist/components/Timestamp.js +1 -1
- package/dist/utils/formatTimestamp.js +1 -1
- package/docs/components/accordion.html +4 -0
- package/docs/components/aside.html +4 -0
- package/docs/components/calendar.html +4 -0
- package/docs/components/card.html +4 -0
- package/docs/components/chat.html +4 -0
- package/docs/components/code-editor.html +4 -0
- package/docs/components/color-picker.html +4 -0
- package/docs/components/combobox.html +4 -0
- package/docs/components/content-slider.html +4 -0
- package/docs/components/context.html +4 -0
- package/docs/components/dialog.html +4 -0
- package/docs/components/dropdown.html +4 -0
- package/docs/components/filter-list.html +4 -0
- package/docs/components/focus-capture.html +4 -0
- package/docs/components/html-editor.html +4 -0
- package/docs/components/hybrid-component.html +4 -0
- package/docs/components/icon.html +4 -0
- package/docs/components/import.html +4 -0
- package/docs/components/light-component.html +4 -0
- package/docs/components/markdown-editor.html +4 -0
- package/docs/components/markdown.html +650 -0
- package/docs/components/nav-spacer.html +4 -0
- package/docs/components/nav.html +4 -0
- package/docs/components/photo-viewer.html +4 -0
- package/docs/components/progress.html +4 -0
- package/docs/components/resize.html +4 -0
- package/docs/components/shadow-component.html +4 -0
- package/docs/components/show-more.html +4 -0
- package/docs/components/slider.html +4 -0
- package/docs/components/sortable.html +4 -0
- package/docs/components/speech-to-text.html +4 -0
- package/docs/components/spinner.html +4 -0
- package/docs/components/split.html +4 -0
- package/docs/components/table.html +4 -0
- package/docs/components/tableControls.html +4 -0
- package/docs/components/tableCustomFields.html +4 -0
- package/docs/components/tableFetchRecords.html +4 -0
- package/docs/components/tableFieldSortHide.html +4 -0
- package/docs/components/tablePagination.html +4 -0
- package/docs/components/tablePlaceholder.html +4 -0
- package/docs/components/tableRecordEditing.html +4 -0
- package/docs/components/tableRecordFiltering.html +4 -0
- package/docs/components/tableRecordHiding.html +4 -0
- package/docs/components/tableRecordSearching.html +4 -0
- package/docs/components/tableRecordSelection.html +4 -0
- package/docs/components/tableRowControls.html +4 -0
- package/docs/components/tableServerSync.html +4 -0
- package/docs/components/tableSorting.html +4 -0
- package/docs/components/tabs.html +4 -0
- package/docs/components/tags.html +4 -0
- package/docs/components/text-to-speech.html +4 -0
- package/docs/components/theme-select.html +4 -0
- package/docs/components/theme-switcher.html +4 -0
- package/docs/components/time.html +4 -0
- package/docs/components/timestamp.html +4 -0
- package/docs/components/toast.html +4 -0
- package/docs/components/toggle.html +4 -0
- package/docs/components/tree.html +4 -0
- package/docs/components/voice-selector.html +4 -0
- package/docs/index.html +10 -0
- package/docs/src/components/Markdown.js +1 -0
- package/docs/src/components/Timestamp.js +1 -1
- package/docs/src/utils/formatTimestamp.js +1 -1
- package/docs/utils/context.html +4 -0
- package/docs/utils/cookie.html +4 -0
- package/docs/utils/debounce.html +4 -0
- package/docs/utils/drag.html +4 -0
- package/docs/utils/elevation.html +4 -0
- package/docs/utils/formatTimestamp.html +4 -0
- package/docs/utils/object.html +4 -0
- package/docs/utils/propConverters.html +4 -0
- package/docs/utils/sanitizeHtml.html +4 -0
- package/docs/utils/string.html +4 -0
- package/docs/utils/theme.html +4 -0
- package/docs/utils/toTitleCase.html +4 -0
- package/docs/utils/type.html +4 -0
- package/docs/utils/voice.html +4 -0
- package/docs/utils/wait.html +4 -0
- package/docs-src/components/markdown.page.html +161 -0
- package/docs-src/index.page.html +6 -0
- package/docs-src/nav.fragment.html +4 -0
- package/llms.txt +1 -0
- package/package.json +1 -1
- package/src/components/Markdown.js +125 -0
- package/src/components/Timestamp.js +3 -3
- package/src/utils/formatTimestamp.js +2 -1
- package/tests/components/Markdown.browser-test.js +292 -0
|
@@ -0,0 +1,650 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>Markdown - Components - Kempo Docs - A Web Components Solution</title>
|
|
7
|
+
<link rel="icon" type="image/png" sizes="48x48" href="../media/icon48.png">
|
|
8
|
+
<link rel="manifest" href="../manifest.json" />
|
|
9
|
+
<link rel="stylesheet" href="../kempo-vars.css" />
|
|
10
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/kempo-css@2/dist/kempo.min.css" />
|
|
11
|
+
<link rel="stylesheet" href="../kempo-hljs.css" />
|
|
12
|
+
<link rel="stylesheet" href="../styles.css" />
|
|
13
|
+
<script>window.litDisableBundleWarning = true;</script>
|
|
14
|
+
|
|
15
|
+
</head>
|
|
16
|
+
<body>
|
|
17
|
+
|
|
18
|
+
<k-nav
|
|
19
|
+
fixed
|
|
20
|
+
class="bg-primary"
|
|
21
|
+
>
|
|
22
|
+
<button
|
|
23
|
+
id="toggleNavSideMenu"
|
|
24
|
+
class="link"
|
|
25
|
+
>
|
|
26
|
+
<k-icon name="menu"></k-icon>
|
|
27
|
+
</button>
|
|
28
|
+
<a
|
|
29
|
+
href="../"
|
|
30
|
+
class="d-if ph"
|
|
31
|
+
style="align-items: center"
|
|
32
|
+
>
|
|
33
|
+
<img
|
|
34
|
+
src="../media/icon32.png"
|
|
35
|
+
alt="Kempo UI Icon"
|
|
36
|
+
class="pr"
|
|
37
|
+
/>
|
|
38
|
+
Kempo UI
|
|
39
|
+
</a>
|
|
40
|
+
<div
|
|
41
|
+
style="position:relative;margin:0 .25rem;align-self:center;"
|
|
42
|
+
theme="light"
|
|
43
|
+
>
|
|
44
|
+
<input
|
|
45
|
+
id="navSearchInput"
|
|
46
|
+
type="search"
|
|
47
|
+
placeholder="Search docs..."
|
|
48
|
+
autocomplete="off"
|
|
49
|
+
style="width:11rem;"
|
|
50
|
+
/>
|
|
51
|
+
<div
|
|
52
|
+
id="navSearchDropdown"
|
|
53
|
+
hidden
|
|
54
|
+
theme="light"
|
|
55
|
+
style="position:absolute;top:calc(100% + 4px);left:0;width:min(480px,90vw);max-height:70vh;background:var(--c_bg);border:1px solid var(--c_border);border-radius:var(--radius);overflow:auto;z-index:9999;box-shadow:0 4px 12px rgba(0,0,0,.3);"
|
|
56
|
+
>
|
|
57
|
+
<k-filter-list
|
|
58
|
+
id="navSearchList"
|
|
59
|
+
style="display:block;padding:.25rem 0;"
|
|
60
|
+
>
|
|
61
|
+
<k-filter-item filter-keywords="accordion components"><a
|
|
62
|
+
href="../components/accordion.html">Accordion<br><small>Component</small></a></k-filter-item>
|
|
63
|
+
<k-filter-item filter-keywords="aside sidebar components"><a
|
|
64
|
+
href="../components/aside.html">Aside<br><small>Component</small></a></k-filter-item>
|
|
65
|
+
<k-filter-item filter-keywords="calendar date picker range month day components"><a
|
|
66
|
+
href="../components/calendar.html"
|
|
67
|
+
>Calendar<br><small>Component</small></a></k-filter-item>
|
|
68
|
+
<k-filter-item filter-keywords="card components"><a
|
|
69
|
+
href="../components/card.html">Card<br><small>Component</small></a></k-filter-item>
|
|
70
|
+
<k-filter-item filter-keywords="chat message conversation messaging components"><a
|
|
71
|
+
href="../components/chat.html"
|
|
72
|
+
>Chat<br><small>Component</small></a></k-filter-item>
|
|
73
|
+
<k-filter-item filter-keywords="code editor codeeditor monaco components"><a
|
|
74
|
+
href="../components/code-editor.html"
|
|
75
|
+
>Code Editor<br><small>Component</small></a></k-filter-item>
|
|
76
|
+
<k-filter-item filter-keywords="combobox combo box search autocomplete components"><a
|
|
77
|
+
href="../components/combobox.html"
|
|
78
|
+
>Combobox<br><small>Component</small></a></k-filter-item>
|
|
79
|
+
<k-filter-item filter-keywords="color picker colorpicker components"><a
|
|
80
|
+
href="../components/color-picker.html"
|
|
81
|
+
>Color Picker<br><small>Component</small></a></k-filter-item>
|
|
82
|
+
<k-filter-item filter-keywords="content slider components"><a
|
|
83
|
+
href="../components/content-slider.html"
|
|
84
|
+
>Content Slider<br><small>Component</small></a></k-filter-item>
|
|
85
|
+
<k-filter-item filter-keywords="context state global components"><a
|
|
86
|
+
href="../components/context.html"
|
|
87
|
+
>Context<br><small>Component</small></a></k-filter-item>
|
|
88
|
+
<k-filter-item filter-keywords="dialog modal popup components"><a
|
|
89
|
+
href="../components/dialog.html">Dialog<br><small>Component</small></a></k-filter-item>
|
|
90
|
+
<k-filter-item filter-keywords="dropdown select components"><a
|
|
91
|
+
href="../components/dropdown.html">Dropdown<br><small>Component</small></a></k-filter-item>
|
|
92
|
+
<k-filter-item filter-keywords="filter list filterlist components"><a
|
|
93
|
+
href="../components/filter-list.html"
|
|
94
|
+
>Filter List<br><small>Component</small></a></k-filter-item>
|
|
95
|
+
<k-filter-item filter-keywords="focus capture focuscapture components"><a
|
|
96
|
+
href="../components/focus-capture.html"
|
|
97
|
+
>Focus Capture<br><small>Component</small></a></k-filter-item>
|
|
98
|
+
<k-filter-item filter-keywords="html editor components"><a
|
|
99
|
+
href="../components/html-editor.html">HTML
|
|
100
|
+
Editor<br><small>Component</small></a></k-filter-item>
|
|
101
|
+
<k-filter-item filter-keywords="markdown render parser marked gfm components"><a
|
|
102
|
+
href="../components/markdown.html"
|
|
103
|
+
>Markdown<br><small>Component</small></a></k-filter-item>
|
|
104
|
+
<k-filter-item filter-keywords="markdown editor markdowneditor write preview marked gfm tables components"><a
|
|
105
|
+
href="../components/markdown-editor.html"
|
|
106
|
+
>Markdown Editor<br><small>Component</small></a></k-filter-item>
|
|
107
|
+
<k-filter-item filter-keywords="icon components"><a
|
|
108
|
+
href="../components/icon.html">Icon<br><small>Component</small></a></k-filter-item>
|
|
109
|
+
<k-filter-item filter-keywords="import components"><a
|
|
110
|
+
href="../components/import.html">Import<br><small>Component</small></a></k-filter-item>
|
|
111
|
+
<k-filter-item filter-keywords="nav navbar navigation components"><a
|
|
112
|
+
href="../components/nav.html">Nav<br><small>Component</small></a></k-filter-item>
|
|
113
|
+
<k-filter-item filter-keywords="nav spacer navbar spacer navspacer components"><a
|
|
114
|
+
href="../components/nav-spacer.html"
|
|
115
|
+
>Nav Spacer<br><small>Component</small></a></k-filter-item>
|
|
116
|
+
<k-filter-item filter-keywords="photo viewer photoviewer components"><a
|
|
117
|
+
href="../components/photo-viewer.html"
|
|
118
|
+
>Photo Viewer<br><small>Component</small></a></k-filter-item>
|
|
119
|
+
<k-filter-item filter-keywords="progress loading components"><a
|
|
120
|
+
href="../components/progress.html">Progress<br><small>Component</small></a></k-filter-item>
|
|
121
|
+
<k-filter-item filter-keywords="resize components"><a
|
|
122
|
+
href="../components/resize.html">Resize<br><small>Component</small></a></k-filter-item>
|
|
123
|
+
<k-filter-item filter-keywords="show more showmore components"><a
|
|
124
|
+
href="../components/show-more.html"
|
|
125
|
+
>Show More<br><small>Component</small></a></k-filter-item>
|
|
126
|
+
<k-filter-item filter-keywords="slider range input step components"><a
|
|
127
|
+
href="../components/slider.html"
|
|
128
|
+
>Slider<br><small>Component</small></a></k-filter-item>
|
|
129
|
+
<k-filter-item filter-keywords="sortable drag drop sort components"><a
|
|
130
|
+
href="../components/sortable.html"
|
|
131
|
+
>Sortable<br><small>Component</small></a></k-filter-item>
|
|
132
|
+
<k-filter-item filter-keywords="speech to text speechtotext microphone voice recognition transcription components"><a
|
|
133
|
+
href="../components/speech-to-text.html"
|
|
134
|
+
>Speech To Text<br><small>Component</small></a></k-filter-item>
|
|
135
|
+
<k-filter-item filter-keywords="spinner loading components"><a
|
|
136
|
+
href="../components/spinner.html">Spinner<br><small>Component</small></a></k-filter-item>
|
|
137
|
+
<k-filter-item filter-keywords="split pane components"><a
|
|
138
|
+
href="../components/split.html">Split<br><small>Component</small></a></k-filter-item>
|
|
139
|
+
<k-filter-item filter-keywords="table data grid components"><a
|
|
140
|
+
href="../components/table.html">Table<br><small>Component</small></a></k-filter-item>
|
|
141
|
+
<k-filter-item filter-keywords="table controls advanced example"><a
|
|
142
|
+
href="../components/tableControls.html"
|
|
143
|
+
>Table — Controls<br><small>Advanced Example</small></a></k-filter-item>
|
|
144
|
+
<k-filter-item filter-keywords="table custom fields advanced example"><a
|
|
145
|
+
href="../components/tableCustomFields.html"
|
|
146
|
+
>Table — Custom Fields<br><small>Advanced Example</small></a></k-filter-item>
|
|
147
|
+
<k-filter-item filter-keywords="table fetch records advanced example"><a
|
|
148
|
+
href="../components/tableFetchRecords.html"
|
|
149
|
+
>Table — Fetch Records<br><small>Advanced Example</small></a></k-filter-item>
|
|
150
|
+
<k-filter-item filter-keywords="table field sort hide advanced example"><a
|
|
151
|
+
href="../components/tableFieldSortHide.html"
|
|
152
|
+
>Table — Field Sort & Hide<br><small>Advanced Example</small></a></k-filter-item>
|
|
153
|
+
<k-filter-item filter-keywords="table pagination advanced example"><a
|
|
154
|
+
href="../components/tablePagination.html"
|
|
155
|
+
>Table — Pagination<br><small>Advanced Example</small></a></k-filter-item>
|
|
156
|
+
<k-filter-item filter-keywords="table record editing advanced example"><a
|
|
157
|
+
href="../components/tableRecordEditing.html"
|
|
158
|
+
>Table — Record Editing<br><small>Advanced Example</small></a></k-filter-item>
|
|
159
|
+
<k-filter-item filter-keywords="table record filtering advanced example"><a
|
|
160
|
+
href="../components/tableRecordFiltering.html"
|
|
161
|
+
>Table — Record Filtering<br><small>Advanced Example</small></a></k-filter-item>
|
|
162
|
+
<k-filter-item filter-keywords="table record hiding advanced example"><a
|
|
163
|
+
href="../components/tableRecordHiding.html"
|
|
164
|
+
>Table — Record Hiding<br><small>Advanced Example</small></a></k-filter-item>
|
|
165
|
+
<k-filter-item filter-keywords="table record searching advanced example"><a
|
|
166
|
+
href="../components/tableRecordSearching.html"
|
|
167
|
+
>Table — Record Searching<br><small>Advanced Example</small></a></k-filter-item>
|
|
168
|
+
<k-filter-item filter-keywords="table record selection advanced example"><a
|
|
169
|
+
href="../components/tableRecordSelection.html"
|
|
170
|
+
>Table — Record Selection<br><small>Advanced Example</small></a></k-filter-item>
|
|
171
|
+
<k-filter-item filter-keywords="table row controls advanced example"><a
|
|
172
|
+
href="../components/tableRowControls.html"
|
|
173
|
+
>Table — Row Controls<br><small>Advanced Example</small></a></k-filter-item>
|
|
174
|
+
<k-filter-item filter-keywords="table server sync advanced example"><a
|
|
175
|
+
href="../components/tableServerSync.html"
|
|
176
|
+
>Table — Server Sync<br><small>Advanced Example</small></a></k-filter-item>
|
|
177
|
+
<k-filter-item filter-keywords="table sorting advanced example"><a
|
|
178
|
+
href="../components/tableSorting.html"
|
|
179
|
+
>Table — Sorting<br><small>Advanced Example</small></a></k-filter-item>
|
|
180
|
+
<k-filter-item filter-keywords="table placeholder advanced example"><a
|
|
181
|
+
href="../components/tablePlaceholder.html"
|
|
182
|
+
>Table — Placeholder<br><small>Advanced Example</small></a></k-filter-item>
|
|
183
|
+
<k-filter-item filter-keywords="tabs tab panel components"><a
|
|
184
|
+
href="../components/tabs.html">Tabs<br><small>Component</small></a></k-filter-item>
|
|
185
|
+
<k-filter-item filter-keywords="tags tag input components"><a
|
|
186
|
+
href="../components/tags.html">Tags<br><small>Component</small></a></k-filter-item>
|
|
187
|
+
<k-filter-item filter-keywords="text to speech texttospeech tts speak voice synthesis components"><a
|
|
188
|
+
href="../components/text-to-speech.html"
|
|
189
|
+
>Text To Speech<br><small>Component</small></a></k-filter-item>
|
|
190
|
+
<k-filter-item filter-keywords="theme select dropdown dark light components"><a
|
|
191
|
+
href="../components/theme-select.html"
|
|
192
|
+
>Theme Select<br><small>Component</small></a></k-filter-item>
|
|
193
|
+
<k-filter-item filter-keywords="theme switcher dark light components"><a
|
|
194
|
+
href="../components/theme-switcher.html"
|
|
195
|
+
>Theme Switcher<br><small>Component</small></a></k-filter-item>
|
|
196
|
+
<k-filter-item filter-keywords="time picker clock hour minute form components"><a
|
|
197
|
+
href="../components/time.html"
|
|
198
|
+
>Time<br><small>Component</small></a></k-filter-item>
|
|
199
|
+
<k-filter-item filter-keywords="timestamp date time components"><a
|
|
200
|
+
href="../components/timestamp.html"
|
|
201
|
+
>Timestamp<br><small>Component</small></a></k-filter-item>
|
|
202
|
+
<k-filter-item filter-keywords="toast notification alert components"><a
|
|
203
|
+
href="../components/toast.html"
|
|
204
|
+
>Toast<br><small>Component</small></a></k-filter-item>
|
|
205
|
+
<k-filter-item filter-keywords="toggle switch checkbox components"><a
|
|
206
|
+
href="../components/toggle.html"
|
|
207
|
+
>Toggle<br><small>Component</small></a></k-filter-item>
|
|
208
|
+
<k-filter-item filter-keywords="tree treeview components"><a
|
|
209
|
+
href="../components/tree.html">Tree<br><small>Component</small></a></k-filter-item>
|
|
210
|
+
<k-filter-item filter-keywords="voice selector dropdown speech synthesis preference components"><a
|
|
211
|
+
href="../components/voice-selector.html"
|
|
212
|
+
>Voice Selector<br><small>Component</small></a></k-filter-item>
|
|
213
|
+
<k-filter-item filter-keywords="shadow component base"><a
|
|
214
|
+
href="../components/shadow-component.html"
|
|
215
|
+
>Shadow Component<br><small>Base Component</small></a></k-filter-item>
|
|
216
|
+
<k-filter-item filter-keywords="light component base"><a
|
|
217
|
+
href="../components/light-component.html">Light Component<br><small>Base
|
|
218
|
+
Component</small></a></k-filter-item>
|
|
219
|
+
<k-filter-item filter-keywords="hybrid component base"><a
|
|
220
|
+
href="../components/hybrid-component.html"
|
|
221
|
+
>Hybrid Component<br><small>Base Component</small></a></k-filter-item>
|
|
222
|
+
<k-filter-item filter-keywords="cookie utils utility"><a
|
|
223
|
+
href="../utils/cookie.html">cookie<br><small>Utility</small></a></k-filter-item>
|
|
224
|
+
<k-filter-item filter-keywords="context utils utility"><a
|
|
225
|
+
href="../utils/context.html">context<br><small>Utility</small></a></k-filter-item>
|
|
226
|
+
<k-filter-item filter-keywords="debounce utils utility"><a
|
|
227
|
+
href="../utils/debounce.html">debounce<br><small>Utility</small></a></k-filter-item>
|
|
228
|
+
<k-filter-item filter-keywords="drag utils utility"><a
|
|
229
|
+
href="../utils/drag.html">drag<br><small>Utility</small></a></k-filter-item>
|
|
230
|
+
<k-filter-item filter-keywords="elevation z-index stacking utils"><a
|
|
231
|
+
href="../utils/elevation.html">elevation<br><small>Utility</small></a></k-filter-item>
|
|
232
|
+
<k-filter-item filter-keywords="formattimestamp timestamp format date time utils utility"><a
|
|
233
|
+
href="../utils/formatTimestamp.html"
|
|
234
|
+
>formatTimestamp<br><small>Utility</small></a></k-filter-item>
|
|
235
|
+
<k-filter-item filter-keywords="object utils utility"><a
|
|
236
|
+
href="../utils/object.html">object<br><small>Utility</small></a></k-filter-item>
|
|
237
|
+
<k-filter-item filter-keywords="propconverters prop converters utils utility"><a
|
|
238
|
+
href="../utils/propConverters.html"
|
|
239
|
+
>propConverters<br><small>Utility</small></a></k-filter-item>
|
|
240
|
+
<k-filter-item filter-keywords="sanitizehtml sanitize html xss security utils utility"><a
|
|
241
|
+
href="../utils/sanitizeHtml.html"
|
|
242
|
+
>sanitizeHtml<br><small>Utility</small></a></k-filter-item>
|
|
243
|
+
<k-filter-item filter-keywords="string utils utility"><a
|
|
244
|
+
href="../utils/string.html">string<br><small>Utility</small></a></k-filter-item>
|
|
245
|
+
<k-filter-item filter-keywords="theme utils utility"><a
|
|
246
|
+
href="../utils/theme.html">theme<br><small>Utility</small></a></k-filter-item>
|
|
247
|
+
<k-filter-item filter-keywords="type utils utility"><a
|
|
248
|
+
href="../utils/type.html">type<br><small>Utility</small></a></k-filter-item>
|
|
249
|
+
<k-filter-item filter-keywords="voice speech synthesis preference utils utility"><a
|
|
250
|
+
href="../utils/voice.html">voice<br><small>Utility</small></a></k-filter-item>
|
|
251
|
+
<k-filter-item filter-keywords="wait async utils utility"><a
|
|
252
|
+
href="../utils/wait.html">wait<br><small>Utility</small></a></k-filter-item>
|
|
253
|
+
</k-filter-list>
|
|
254
|
+
</div>
|
|
255
|
+
</div>
|
|
256
|
+
<div class="flex"></div>
|
|
257
|
+
<a
|
|
258
|
+
href="https://github.com/dustinpoissant/kempo-ui?tab=License-1-ov-file#creative-commons-attribution-noncommercial-sharealike-20"
|
|
259
|
+
target="_blank"
|
|
260
|
+
><k-icon name="license"></k-icon></a>
|
|
261
|
+
<a
|
|
262
|
+
href="https://www.npmjs.com/package/kempo-ui"
|
|
263
|
+
target="_blank"
|
|
264
|
+
><k-icon name="npm"></k-icon></a>
|
|
265
|
+
<a
|
|
266
|
+
href="https://github.com/dustinpoissant/kempo-ui"
|
|
267
|
+
target="_blank"
|
|
268
|
+
><k-icon name="github-mark"></k-icon></a>
|
|
269
|
+
<k-theme-switcher
|
|
270
|
+
class="mr"
|
|
271
|
+
style="
|
|
272
|
+
--padding: 0.5rem;
|
|
273
|
+
--c_active: var(--tc_on_primary);
|
|
274
|
+
--tc_active: var(--c_primary);
|
|
275
|
+
--c_inactive__hover: rgba(255, 255, 255, 0.1);
|
|
276
|
+
"
|
|
277
|
+
></k-theme-switcher>
|
|
278
|
+
</k-nav>
|
|
279
|
+
<div style="width: 100%; height: 4rem;"></div>
|
|
280
|
+
<k-aside
|
|
281
|
+
id="navSideMenu"
|
|
282
|
+
main="overlay"
|
|
283
|
+
state="offscreen"
|
|
284
|
+
>
|
|
285
|
+
<menu>
|
|
286
|
+
<a
|
|
287
|
+
href="../"
|
|
288
|
+
class="ta-center bb mb r0"
|
|
289
|
+
>
|
|
290
|
+
<h1 class="tc-primary">Kempo UI</h1>
|
|
291
|
+
<img
|
|
292
|
+
src="../media/icon128.png"
|
|
293
|
+
alt="Kempo UI Icon"
|
|
294
|
+
/>
|
|
295
|
+
</a>
|
|
296
|
+
|
|
297
|
+
<div class="pl mb">
|
|
298
|
+
<h3>Components</h3>
|
|
299
|
+
<a href="../components/accordion.html">Accordion</a>
|
|
300
|
+
<a href="../components/aside.html">Aside</a>
|
|
301
|
+
<a href="../components/calendar.html">Calendar</a>
|
|
302
|
+
<a href="../components/card.html">Card</a>
|
|
303
|
+
<a href="../components/chat.html">Chat</a>
|
|
304
|
+
<a href="../components/code-editor.html">Code Editor</a>
|
|
305
|
+
<a href="../components/combobox.html">Combobox</a>
|
|
306
|
+
<a href="../components/color-picker.html">ColorPicker</a>
|
|
307
|
+
<a href="../components/content-slider.html">Content Slider</a>
|
|
308
|
+
<a href="../components/context.html">Context</a>
|
|
309
|
+
<a href="../components/dialog.html">Dialog</a>
|
|
310
|
+
<a href="../components/dropdown.html">Dropdown</a>
|
|
311
|
+
<a href="../components/filter-list.html">Filter List</a>
|
|
312
|
+
<a href="../components/focus-capture.html">FocusCapture</a>
|
|
313
|
+
<a href="../components/html-editor.html">HTML Editor</a>
|
|
314
|
+
<a href="../components/markdown.html">Markdown</a>
|
|
315
|
+
<a href="../components/markdown-editor.html">Markdown Editor</a>
|
|
316
|
+
<a href="../components/icon.html">Icon</a>
|
|
317
|
+
<a href="../components/import.html">Import</a>
|
|
318
|
+
<a href="../components/nav.html">Nav</a>
|
|
319
|
+
<a href="../components/nav-spacer.html">Nav Spacer</a>
|
|
320
|
+
<a href="../components/photo-viewer.html">Photo Viewer</a>
|
|
321
|
+
<a href="../components/progress.html">Progress</a>
|
|
322
|
+
<a href="../components/resize.html">Resize</a>
|
|
323
|
+
<a href="../components/show-more.html">Show More</a>
|
|
324
|
+
<a href="../components/slider.html">Slider</a>
|
|
325
|
+
<a href="../components/sortable.html">Sortable</a>
|
|
326
|
+
<a href="../components/speech-to-text.html">Speech To Text</a>
|
|
327
|
+
<a href="../components/spinner.html">Spinner</a>
|
|
328
|
+
<a href="../components/split.html">Split</a>
|
|
329
|
+
<a href="../components/table.html">Table</a>
|
|
330
|
+
<a href="../components/tabs.html">Tabs</a>
|
|
331
|
+
<a href="../components/tags.html">Tags</a>
|
|
332
|
+
<a href="../components/text-to-speech.html">Text To Speech</a>
|
|
333
|
+
<a href="../components/theme-select.html">Theme Select</a>
|
|
334
|
+
<a href="../components/theme-switcher.html">Theme Switcher</a>
|
|
335
|
+
<a href="../components/time.html">Time</a>
|
|
336
|
+
<a href="../components/timestamp.html">Timestamp</a>
|
|
337
|
+
<a href="../components/toast.html">Toast</a>
|
|
338
|
+
<a href="../components/toggle.html">Toggle</a>
|
|
339
|
+
<a href="../components/tree.html">Tree</a>
|
|
340
|
+
<a href="../components/voice-selector.html">Voice Selector</a>
|
|
341
|
+
</div>
|
|
342
|
+
|
|
343
|
+
<h5 class="mb0">Base Components</h5>
|
|
344
|
+
<div class="pl mb">
|
|
345
|
+
<a href="../components/shadow-component.html">Shadow Component</a>
|
|
346
|
+
<a href="../components/light-component.html">Light Component</a>
|
|
347
|
+
<a href="../components/hybrid-component.html">Hybrid Component</a>
|
|
348
|
+
</div>
|
|
349
|
+
|
|
350
|
+
<h5 class="mb0">Utils</h5>
|
|
351
|
+
<div class="pl mb">
|
|
352
|
+
<a href="../utils/cookie.html">cookie</a>
|
|
353
|
+
<a href="../utils/context.html">context</a>
|
|
354
|
+
<a href="../utils/debounce.html">debounce</a>
|
|
355
|
+
<a href="../utils/drag.html">drag</a>
|
|
356
|
+
<a href="../utils/elevation.html">elevation</a>
|
|
357
|
+
<a href="../utils/formatTimestamp.html">formatTimestamp</a>
|
|
358
|
+
<a href="../utils/object.html">object</a>
|
|
359
|
+
<a href="../utils/propConverters.html">propConverters</a>
|
|
360
|
+
<a href="../utils/sanitizeHtml.html">sanitizeHtml</a>
|
|
361
|
+
<a href="../utils/string.html">string</a>
|
|
362
|
+
<a href="../utils/theme.html">theme</a>
|
|
363
|
+
<a href="../utils/type.html">type</a>
|
|
364
|
+
<a href="../utils/voice.html">voice</a>
|
|
365
|
+
<a href="../utils/wait.html">wait</a>
|
|
366
|
+
</div>
|
|
367
|
+
</menu>
|
|
368
|
+
</k-aside>
|
|
369
|
+
<style>
|
|
370
|
+
#navSearchList a {
|
|
371
|
+
display: block;
|
|
372
|
+
padding: .25rem .5rem;
|
|
373
|
+
border-radius: var(--radius);
|
|
374
|
+
text-decoration: none;
|
|
375
|
+
color: var(--tc);
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
#navSearchList a:hover {
|
|
379
|
+
background: rgba(128, 128, 128, .15);
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
#navSearchList a small {
|
|
383
|
+
display: block;
|
|
384
|
+
color: var(--tc_muted);
|
|
385
|
+
}
|
|
386
|
+
</style>
|
|
387
|
+
<script
|
|
388
|
+
src="../src/components/Nav.js"
|
|
389
|
+
type="module"
|
|
390
|
+
></script>
|
|
391
|
+
<script
|
|
392
|
+
src="../src/components/FilterList.js"
|
|
393
|
+
type="module"
|
|
394
|
+
></script>
|
|
395
|
+
<script
|
|
396
|
+
src="../src/components/FilterItem.js"
|
|
397
|
+
type="module"
|
|
398
|
+
></script>
|
|
399
|
+
<script
|
|
400
|
+
src="../src/components/Aside.js"
|
|
401
|
+
type="module"
|
|
402
|
+
></script>
|
|
403
|
+
<script
|
|
404
|
+
src="../src/components/Icon.js"
|
|
405
|
+
type="module"
|
|
406
|
+
></script>
|
|
407
|
+
<script
|
|
408
|
+
src="../src/components/ThemeSwitcher.js"
|
|
409
|
+
type="module"
|
|
410
|
+
></script>
|
|
411
|
+
<script type="module">
|
|
412
|
+
import debounce from '../src/utils/debounce.js';
|
|
413
|
+
|
|
414
|
+
document.getElementById('toggleNavSideMenu').addEventListener('click', async () => {
|
|
415
|
+
await window.customElements.whenDefined('k-aside');
|
|
416
|
+
document.getElementById('navSideMenu').toggle();
|
|
417
|
+
});
|
|
418
|
+
|
|
419
|
+
document.addEventListener('click', function (e) {
|
|
420
|
+
if (e.target.matches('a[href^="#"]')) {
|
|
421
|
+
e.preventDefault();
|
|
422
|
+
const targetId = e.target.getAttribute('href').replace('#', '');
|
|
423
|
+
const target = document.getElementById(targetId);
|
|
424
|
+
if (target) {
|
|
425
|
+
target.scrollIntoView({ behavior: 'smooth' });
|
|
426
|
+
const url = window.location.pathname + window.location.search + '#' + targetId;
|
|
427
|
+
history.replaceState(null, '', url);
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
});
|
|
431
|
+
|
|
432
|
+
/*
|
|
433
|
+
Nav Search
|
|
434
|
+
*/
|
|
435
|
+
const searchInput = document.getElementById('navSearchInput');
|
|
436
|
+
const searchDropdown = document.getElementById('navSearchDropdown');
|
|
437
|
+
let navSearchList = null;
|
|
438
|
+
|
|
439
|
+
const openSearch = async () => {
|
|
440
|
+
await customElements.whenDefined('k-filter-list');
|
|
441
|
+
if (!navSearchList) navSearchList = document.getElementById('navSearchList');
|
|
442
|
+
navSearchList.filter(searchInput.value);
|
|
443
|
+
searchDropdown.hidden = false;
|
|
444
|
+
};
|
|
445
|
+
|
|
446
|
+
const closeSearch = () => {
|
|
447
|
+
searchDropdown.hidden = true;
|
|
448
|
+
navSearchList?.clearFocus();
|
|
449
|
+
};
|
|
450
|
+
|
|
451
|
+
searchInput.addEventListener('focus', openSearch);
|
|
452
|
+
|
|
453
|
+
searchInput.addEventListener('input', debounce(e => {
|
|
454
|
+
navSearchList?.filter(e.target.value);
|
|
455
|
+
}, 150));
|
|
456
|
+
|
|
457
|
+
searchInput.addEventListener('keydown', e => {
|
|
458
|
+
if (e.key === 'Escape') {
|
|
459
|
+
searchInput.value = '';
|
|
460
|
+
searchInput.blur();
|
|
461
|
+
closeSearch();
|
|
462
|
+
} else if (e.key === 'ArrowDown' || e.key === 'ArrowUp' || e.key === 'Enter') {
|
|
463
|
+
navSearchList?.handleKeydown(e);
|
|
464
|
+
}
|
|
465
|
+
});
|
|
466
|
+
|
|
467
|
+
searchInput.addEventListener('blur', () => {
|
|
468
|
+
setTimeout(closeSearch, 150);
|
|
469
|
+
});
|
|
470
|
+
|
|
471
|
+
document.addEventListener('keydown', e => {
|
|
472
|
+
let active = document.activeElement;
|
|
473
|
+
while (active?.shadowRoot?.activeElement) active = active.shadowRoot.activeElement;
|
|
474
|
+
const tag = active?.tagName;
|
|
475
|
+
if (tag === 'INPUT' || tag === 'TEXTAREA' || active?.isContentEditable) return;
|
|
476
|
+
if (e.metaKey || e.ctrlKey || e.altKey) return;
|
|
477
|
+
if (e.key.length === 1) {
|
|
478
|
+
searchInput.focus();
|
|
479
|
+
}
|
|
480
|
+
});
|
|
481
|
+
</script>
|
|
482
|
+
|
|
483
|
+
|
|
484
|
+
<h1 class="ta-center">Markdown</h1>
|
|
485
|
+
|
|
486
|
+
<k-main>
|
|
487
|
+
|
|
488
|
+
<k-accordion persistent-id="toc" class="b r mb">
|
|
489
|
+
<k-accordion-header for-panel="toc-panel">Table of Contents</k-accordion-header>
|
|
490
|
+
<k-accordion-panel name="toc-panel">
|
|
491
|
+
<div class="m pl">
|
|
492
|
+
<h6>Examples</h6>
|
|
493
|
+
<a href="#basicUsage">Basic Usage</a><br />
|
|
494
|
+
<a href="#valueAttr">Value Attribute</a><br />
|
|
495
|
+
<a href="#breaks">Line Breaks</a><br />
|
|
496
|
+
<a href="#tagFiltering">Tag Filtering</a><br />
|
|
497
|
+
<a href="#dynamic">Updating At Runtime</a><br />
|
|
498
|
+
|
|
499
|
+
<h6 class="mt"><a href="#jsRef" class="no-link">JavaScript Reference</a></h6>
|
|
500
|
+
<a href="#constructor">Constructor</a><br />
|
|
501
|
+
<a href="#requirements">Requirements</a><br />
|
|
502
|
+
<a href="#properties">Properties</a><br />
|
|
503
|
+
<a href="#methods">Methods</a><br />
|
|
504
|
+
</div>
|
|
505
|
+
</k-accordion-panel>
|
|
506
|
+
</k-accordion>
|
|
507
|
+
|
|
508
|
+
<p>The <code>k-markdown</code> component takes its child text content (or a <code>value</code> attribute), parses it as markdown using <a href="https://marked.js.org" target="_blank">marked</a> (full CommonMark + GFM — tables, task lists, fenced code, autolinks, inline HTML), runs the result through <a href="../utils/sanitizeHtml.html"><code>sanitizeHtml</code></a>, and renders the HTML in place. It renders to the light DOM so page-level typography styles cascade naturally into headings, paragraphs, tables, and so on.</p>
|
|
509
|
+
<p>Common leading whitespace is automatically stripped from the source so you can indent the markdown to match the surrounding HTML without breaking parsing.</p>
|
|
510
|
+
|
|
511
|
+
<h3 id="basicUsage"><a href="#basicUsage" class="no-link">Basic Usage</a></h3>
|
|
512
|
+
<p>Drop markdown text inside the tag and it will be replaced with the rendered HTML when the element connects.</p>
|
|
513
|
+
<div class="row -mx mb">
|
|
514
|
+
<div class="col d-span-6 m-span-12 px">
|
|
515
|
+
<k-card label="HTML">
|
|
516
|
+
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">k-markdown</span>></span><br> # Hello World<br><br> This is **bold** and *italic* text.<br><br> - list item 1<br> - list item 2<br><span class="hljs-tag"></<span class="hljs-name">k-markdown</span>></span></code></pre>
|
|
517
|
+
</k-card>
|
|
518
|
+
</div>
|
|
519
|
+
<div class="col d-span-6 m-span-12 px">
|
|
520
|
+
<k-card label="Output">
|
|
521
|
+
<k-markdown>
|
|
522
|
+
# Hello World
|
|
523
|
+
|
|
524
|
+
This is **bold** and *italic* text.
|
|
525
|
+
|
|
526
|
+
- list item 1
|
|
527
|
+
- list item 2
|
|
528
|
+
</k-markdown>
|
|
529
|
+
</k-card>
|
|
530
|
+
</div>
|
|
531
|
+
</div>
|
|
532
|
+
|
|
533
|
+
<h3 id="valueAttr"><a href="#valueAttr" class="no-link">Value Attribute</a></h3>
|
|
534
|
+
<p>Skip the children and pass markdown directly via the <code>value</code> attribute when you only need a single line. The attribute also takes precedence over child content if both are provided.</p>
|
|
535
|
+
<div class="row -mx mb">
|
|
536
|
+
<div class="col d-span-6 m-span-12 px">
|
|
537
|
+
<k-card label="HTML">
|
|
538
|
+
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">k-markdown</span> <span class="hljs-attr">value</span>=<span class="hljs-string">"Visit [Kempo UI](https://github.com/dustinpoissant/kempo-ui) for more."</span>></span><span class="hljs-tag"></<span class="hljs-name">k-markdown</span>></span></code></pre>
|
|
539
|
+
</k-card>
|
|
540
|
+
</div>
|
|
541
|
+
<div class="col d-span-6 m-span-12 px">
|
|
542
|
+
<k-card label="Output">
|
|
543
|
+
<k-markdown value="Visit [Kempo UI](https://github.com/dustinpoissant/kempo-ui) for more."></k-markdown>
|
|
544
|
+
</k-card>
|
|
545
|
+
</div>
|
|
546
|
+
</div>
|
|
547
|
+
|
|
548
|
+
<h3 id="breaks"><a href="#breaks" class="no-link">Line Breaks</a></h3>
|
|
549
|
+
<p>By default, single newlines are joined into a paragraph (CommonMark behavior). Add the <code>breaks</code> attribute to convert single newlines to <code><br></code> — the Slack/iMessage convention — useful for chat-style content.</p>
|
|
550
|
+
<div class="row -mx mb">
|
|
551
|
+
<div class="col d-span-6 m-span-12 px">
|
|
552
|
+
<k-card label="HTML">
|
|
553
|
+
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">k-markdown</span> <span class="hljs-attr">breaks</span>></span><br> Line one<br> Line two<br> Line three<br><span class="hljs-tag"></<span class="hljs-name">k-markdown</span>></span></code></pre>
|
|
554
|
+
</k-card>
|
|
555
|
+
</div>
|
|
556
|
+
<div class="col d-span-6 m-span-12 px">
|
|
557
|
+
<k-card label="Output">
|
|
558
|
+
<k-markdown breaks>
|
|
559
|
+
Line one
|
|
560
|
+
Line two
|
|
561
|
+
Line three
|
|
562
|
+
</k-markdown>
|
|
563
|
+
</k-card>
|
|
564
|
+
</div>
|
|
565
|
+
</div>
|
|
566
|
+
|
|
567
|
+
<h3 id="tagFiltering"><a href="#tagFiltering" class="no-link">Tag Filtering</a></h3>
|
|
568
|
+
<p>The rendered HTML is sanitized with the same <code>allowed-tags</code> / <code>disallowed-tags</code> controls used by <a href="../components/markdown-editor.html"><code>k-markdown-editor</code></a>. Pass a comma-separated allowlist (or <code>*</code> for everything), or a comma-separated denylist — the two are mutually exclusive. <code><script></code>, <code><iframe></code>, <code><style></code>, and similar tags are always stripped unless you opt in with <code>scripts-enabled</code> (which only restores <code><script></code>).</p>
|
|
569
|
+
<div class="row -mx mb">
|
|
570
|
+
<div class="col d-span-6 m-span-12 px">
|
|
571
|
+
<k-card label="HTML">
|
|
572
|
+
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">k-markdown</span> <span class="hljs-attr">allowed-tags</span>=<span class="hljs-string">"p,strong,em,a"</span>></span><br> Only **bold**, *italic*, [links](https://example.com), and paragraphs are kept.<br><br> # This heading will be unwrapped<br><span class="hljs-tag"></<span class="hljs-name">k-markdown</span>></span></code></pre>
|
|
573
|
+
</k-card>
|
|
574
|
+
</div>
|
|
575
|
+
<div class="col d-span-6 m-span-12 px">
|
|
576
|
+
<k-card label="Output">
|
|
577
|
+
<k-markdown allowed-tags="p,strong,em,a">
|
|
578
|
+
Only **bold**, *italic*, [links](https://example.com), and paragraphs are kept.
|
|
579
|
+
|
|
580
|
+
# This heading will be unwrapped
|
|
581
|
+
</k-markdown>
|
|
582
|
+
</k-card>
|
|
583
|
+
</div>
|
|
584
|
+
</div>
|
|
585
|
+
|
|
586
|
+
<h3 id="dynamic"><a href="#dynamic" class="no-link">Updating At Runtime</a></h3>
|
|
587
|
+
<p>Set the <code>value</code> property in JavaScript to re-render with new markdown.</p>
|
|
588
|
+
<div class="row -mx mb">
|
|
589
|
+
<div class="col d-span-6 m-span-12 px">
|
|
590
|
+
<k-card label="HTML">
|
|
591
|
+
<pre><code class="hljs html"><span class="hljs-tag"><<span class="hljs-name">k-markdown</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"dynamicMd"</span> <span class="hljs-attr">value</span>=<span class="hljs-string">"Click the button."</span>></span><span class="hljs-tag"></<span class="hljs-name">k-markdown</span>></span><br><span class="hljs-tag"><<span class="hljs-name">button</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"dynamicMdBtn"</span>></span>Update<span class="hljs-tag"></<span class="hljs-name">button</span>></span><br><span class="hljs-tag"><<span class="hljs-name">script</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"module"</span>></span><span class="language-javascript"><br> <span class="hljs-keyword">const</span> md = <span class="hljs-variable language_">document</span>.<span class="hljs-title function_">getElementById</span>(<span class="hljs-string">'dynamicMd'</span>);<br> <span class="hljs-keyword">const</span> btn = <span class="hljs-variable language_">document</span>.<span class="hljs-title function_">getElementById</span>(<span class="hljs-string">'dynamicMdBtn'</span>);<br> <span class="hljs-keyword">let</span> toggled = <span class="hljs-literal">false</span>;<br> btn.<span class="hljs-title function_">addEventListener</span>(<span class="hljs-string">'click'</span>, <span class="hljs-function">() =></span> {<br> toggled = !toggled;<br> md.<span class="hljs-property">value</span> = toggled<br> ? <span class="hljs-string">'## Updated!\n\nThis was set via JavaScript with **markdown** and a [link](https://example.com).'</span><br> : <span class="hljs-string">'Click the button.'</span>;<br> });<br></span><span class="hljs-tag"></<span class="hljs-name">script</span>></span></code></pre>
|
|
592
|
+
</k-card>
|
|
593
|
+
</div>
|
|
594
|
+
<div class="col d-span-6 m-span-12 px">
|
|
595
|
+
<k-card label="Output">
|
|
596
|
+
<k-markdown id="dynamicMd" value="Click the button."></k-markdown>
|
|
597
|
+
<button id="dynamicMdBtn" class="btn primary mt">Update</button>
|
|
598
|
+
</k-card>
|
|
599
|
+
</div>
|
|
600
|
+
</div>
|
|
601
|
+
|
|
602
|
+
<h2 id="jsRef"><a href="#jsRef" class="no-link">JavaScript Reference</a></h2>
|
|
603
|
+
|
|
604
|
+
<h3 id="constructor"><a href="#constructor" class="no-link">Constructor</a></h3>
|
|
605
|
+
<h6>Extends LightComponent</h6>
|
|
606
|
+
|
|
607
|
+
<h3 id="requirements"><a href="#requirements" class="no-link">Requirements</a></h3>
|
|
608
|
+
<ul>
|
|
609
|
+
<li><a href="../components/light-component.html">LightComponent</a></li>
|
|
610
|
+
<li><code>marked</code> (vendored at <code>src/utils/marked.esm.js</code>) via <a href="../utils/renderMarkdown.js"><code>renderMarkdown</code></a></li>
|
|
611
|
+
<li><a href="../utils/sanitizeHtml.html"><code>sanitizeHtml</code></a></li>
|
|
612
|
+
</ul>
|
|
613
|
+
|
|
614
|
+
<h3 id="properties"><a href="#properties" class="no-link">Properties</a></h3>
|
|
615
|
+
<h5><code>value<i>: string</i></code></h5>
|
|
616
|
+
<p>The markdown source. If empty when the element connects, the component falls back to the dedented child text content. Setting this property at runtime re-renders the output.</p>
|
|
617
|
+
<h5><code>breaks<i>: boolean</i></code></h5>
|
|
618
|
+
<p>When <code>true</code>, single newlines convert to <code><br></code> instead of being joined into a paragraph. Defaults to <code>false</code>. Reflects to the <code>breaks</code> attribute.</p>
|
|
619
|
+
<h5><code>allowedTags<i>: string</i></code></h5>
|
|
620
|
+
<p>Comma-separated allowlist for the rendered HTML. Pass <code>*</code> to allow every tag. Mutually exclusive with <code>disallowedTags</code> — if both are set, <code>allowedTags</code> wins and a console warning is logged. Reflects to the <code>allowed-tags</code> attribute.</p>
|
|
621
|
+
<h5><code>disallowedTags<i>: string</i></code></h5>
|
|
622
|
+
<p>Comma-separated denylist — everything is allowed except the listed tags. Reflects to the <code>disallowed-tags</code> attribute.</p>
|
|
623
|
+
<h5><code>scriptsEnabled<i>: boolean</i></code></h5>
|
|
624
|
+
<p>When present, <code><script></code> tags survive sanitization (provided they also pass the allow/deny tag check). Defaults to off so script content can never reach the DOM. Reflects to the <code>scripts-enabled</code> attribute.</p>
|
|
625
|
+
|
|
626
|
+
<h3 id="methods"><a href="#methods" class="no-link">Methods</a></h3>
|
|
627
|
+
<h5><code>renderedHtml<i>: string</i></code> (getter)</h5>
|
|
628
|
+
<p>Returns the sanitized HTML string that was rendered — useful for copying the output or feeding it into another component.</p>
|
|
629
|
+
|
|
630
|
+
</k-main>
|
|
631
|
+
<div style="height:33vh"></div>
|
|
632
|
+
<script type="module" src="../src/components/Main.js"></script>
|
|
633
|
+
|
|
634
|
+
<script type="module" src="../src/components/Markdown.js"></script>
|
|
635
|
+
<script type="module" src="../src/components/Accordion.js"></script>
|
|
636
|
+
<script type="module" src="../src/components/Card.js"></script>
|
|
637
|
+
<script type="module">
|
|
638
|
+
const md = document.getElementById('dynamicMd');
|
|
639
|
+
const btn = document.getElementById('dynamicMdBtn');
|
|
640
|
+
let toggled = false;
|
|
641
|
+
btn.addEventListener('click', () => {
|
|
642
|
+
toggled = !toggled;
|
|
643
|
+
md.value = toggled
|
|
644
|
+
? '## Updated!\n\nThis was set via JavaScript with **markdown** and a [link](https://example.com).'
|
|
645
|
+
: 'Click the button.';
|
|
646
|
+
});
|
|
647
|
+
</script>
|
|
648
|
+
|
|
649
|
+
</body>
|
|
650
|
+
</html>
|