2
0
mirror of https://github.com/Ionaru/easy-markdown-editor synced 2025-07-30 05:14:28 -06:00

Fix issue with selection after deselecting italic

This commit is contained in:
Wes Cossick 2015-06-22 15:52:28 -05:00
parent df988b2f54
commit da30c7f08f
4 changed files with 28 additions and 9 deletions

2
simplemde.min.css vendored

File diff suppressed because one or more lines are too long

12
simplemde.min.js vendored

File diff suppressed because one or more lines are too long

14
source files/README.md Normal file
View File

@ -0,0 +1,14 @@
# How to compile
Minify the JS in this order:
1. `codemirror/codemirror.js`
1. `codemirror/continuelist.js`
1. `codemirror/markdown.js`
1. `codemirror/xml.js`
1. `marked.js`
1. `markdownify.js`
Minify the CSS in this order:
1. `theme.css`
1. `font-awesome.css`

View File

@ -334,8 +334,13 @@ function _toggleBlock(editor, type, start_chars, end_chars) {
ch: 99999999999999
});
startPoint.ch -= 2;
endPoint.ch -= 2;
if (type == "bold") {
startPoint.ch -= 2;
endPoint.ch -= 2;
} else if (type == "italic") {
startPoint.ch -= 1;
endPoint.ch -= 1;
}
} else {
text = cm.getSelection();
if (type == "bold") {