@@ -13,6 +13,7 @@ declare global {
13
13
MarkdownTaskListButtonElement : typeof MarkdownTaskListButtonElement
14
14
MarkdownMentionButtonElement : typeof MarkdownMentionButtonElement
15
15
MarkdownRefButtonElement : typeof MarkdownRefButtonElement
16
+ MarkdownStrikethroughButtonElement : typeof MarkdownStrikethroughButtonElement
16
17
}
17
18
interface HTMLElementTagNameMap {
18
19
'markdown-toolbar' : MarkdownToolbarElement
@@ -28,6 +29,7 @@ declare global {
28
29
'md-task-list' : MarkdownTaskListButtonElement
29
30
'md-mention' : MarkdownMentionButtonElement
30
31
'md-ref' : MarkdownRefButtonElement
32
+ 'md-strikethrough' : MarkdownStrikethroughButtonElement
31
33
}
32
34
}
33
35
@@ -44,7 +46,8 @@ const buttonSelectors = [
44
46
'md-ordered-list' ,
45
47
'md-task-list' ,
46
48
'md-mention' ,
47
- 'md-ref'
49
+ 'md-ref' ,
50
+ 'md-strikethrough'
48
51
]
49
52
function getButtons ( toolbar : Element ) : HTMLElement [ ] {
50
53
const els = [ ]
@@ -279,6 +282,18 @@ if (!window.customElements.get('md-ref')) {
279
282
window . customElements . define ( 'md-ref' , MarkdownRefButtonElement )
280
283
}
281
284
285
+ class MarkdownStrikethroughButtonElement extends MarkdownButtonElement {
286
+ constructor ( ) {
287
+ super ( )
288
+ styles . set ( this , { prefix : '~~' , suffix : '~~' , trimFirst : true } )
289
+ }
290
+ }
291
+
292
+ if ( ! window . customElements . get ( 'md-strikethrough' ) ) {
293
+ window . MarkdownStrikethroughButtonElement = MarkdownStrikethroughButtonElement
294
+ window . customElements . define ( 'md-strikethrough' , MarkdownStrikethroughButtonElement )
295
+ }
296
+
282
297
const modifierKey = navigator . userAgent . match ( / M a c i n t o s h / ) ? 'Meta' : 'Control'
283
298
284
299
class MarkdownToolbarElement extends HTMLElement {
0 commit comments