@@ -13,6 +13,7 @@ declare global {
1313 MarkdownTaskListButtonElement : typeof MarkdownTaskListButtonElement
1414 MarkdownMentionButtonElement : typeof MarkdownMentionButtonElement
1515 MarkdownRefButtonElement : typeof MarkdownRefButtonElement
16+ MarkdownStrikethroughButtonElement : typeof MarkdownStrikethroughButtonElement
1617 }
1718 interface HTMLElementTagNameMap {
1819 'markdown-toolbar' : MarkdownToolbarElement
@@ -28,6 +29,7 @@ declare global {
2829 'md-task-list' : MarkdownTaskListButtonElement
2930 'md-mention' : MarkdownMentionButtonElement
3031 'md-ref' : MarkdownRefButtonElement
32+ 'md-strikethrough' : MarkdownStrikethroughButtonElement
3133 }
3234}
3335
@@ -44,7 +46,8 @@ const buttonSelectors = [
4446 'md-ordered-list' ,
4547 'md-task-list' ,
4648 'md-mention' ,
47- 'md-ref'
49+ 'md-ref' ,
50+ 'md-strikethrough'
4851]
4952function getButtons ( toolbar : Element ) : HTMLElement [ ] {
5053 const els = [ ]
@@ -279,6 +282,18 @@ if (!window.customElements.get('md-ref')) {
279282 window . customElements . define ( 'md-ref' , MarkdownRefButtonElement )
280283}
281284
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+
282297const modifierKey = navigator . userAgent . match ( / M a c i n t o s h / ) ? 'Meta' : 'Control'
283298
284299class MarkdownToolbarElement extends HTMLElement {
0 commit comments