Image-validation (#144)

* Add spoiler tag functionality to CodeMirror

* Refactor image insertion logic in
MarkdownEditor.vue

* Refactor modal state reset functions in
MarkdownEditor.vue
This commit is contained in:
Carter
2023-11-15 14:36:34 -05:00
committed by GitHub
parent fcda48903b
commit 3eead128a6
2 changed files with 21 additions and 8 deletions

View File

@@ -23,7 +23,9 @@ const toggleCodeBlock: Command = ({ state, dispatch }) => {
}
const toggleSpoiler: Command = ({ state, dispatch }) => {
return toggleAround(state, dispatch, '||', '||')
// Insert details tag with a summary tag at the start
const detailsTags = ['\n<details>\n<summary>Spoiler</summary>\n\n', '\n\n</details>\n\n']
return toggleAround(state, dispatch, detailsTags[0], detailsTags[1])
}
const toggleHeader: Command = ({ state, dispatch }) => {