Skip to content

Commit

Permalink
Add boostrap icon map to EasyMDE #304
Browse files Browse the repository at this point in the history
  • Loading branch information
joeroe committed Dec 18, 2023
1 parent 40dad20 commit a39db51
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion app/javascript/controllers/markdown_editor_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,34 @@ export default class extends Controller {
connect() {
this.editor = new EasyMDE({
element: this.fieldTarget,
autoDownloadFontAwesome: false
autoDownloadFontAwesome: false,
iconClassMap: {
'bold': 'bi-type-bold',
'italic': 'bi-type-italic',
'strikethrough': 'bi-type-strikethrough',
'heading': 'bi-hash',
'heading-smaller': 'header-smaller',
'heading-bigger': 'header-bigger',
'heading-1': 'bi-type-h1',
'heading-2': 'bi-type-h2',
'heading-3': 'bi-type-h3',
'code': 'bi-braces',
'quote': 'bi-quote',
'ordered-list': 'bi-list-ol',
'unordered-list': 'bi-list-ul',
'clean-block': 'bi-eraser',
'link': 'bi-link',
'image': 'bi-image',
'upload-image': 'bi-image',
'table': 'bi-table',
'horizontal-rule': 'bi-hr',
'preview': 'bi-eye',
'side-by-side': 'bi-layout-split',
'fullscreen': 'bi-fullscreen',
'guide': 'bi-question-circle',
'undo': 'bi-arrow-counterclockwise',
'redo': 'bi-arrow-clockwise',
}
})
}

Expand Down

0 comments on commit a39db51

Please sign in to comment.