mirror of
https://github.com/Ionaru/easy-markdown-editor
synced 2025-07-25 10:54:28 -06:00
Merge branch 'master' into upload_images
This commit is contained in:
commit
c7275aa72b
32
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
32
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
---
|
||||||
|
name: Bug report
|
||||||
|
about: Create a report to help us improve
|
||||||
|
title: ''
|
||||||
|
labels: Bug
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Describe the bug**
|
||||||
|
A clear and concise description of what the bug is.
|
||||||
|
|
||||||
|
**To Reproduce**
|
||||||
|
Steps to reproduce the behavior:
|
||||||
|
1. Go to '...'
|
||||||
|
2. Click on '....'
|
||||||
|
3. Scroll down to '....'
|
||||||
|
4. See error
|
||||||
|
|
||||||
|
**Expected behavior**
|
||||||
|
A clear and concise description of what you expected to happen.
|
||||||
|
|
||||||
|
**Screenshots**
|
||||||
|
If applicable, add screenshots to help explain your problem.
|
||||||
|
|
||||||
|
** Version information **
|
||||||
|
- OS: [e.g. Windows, MacOS]
|
||||||
|
- Browser: [e.g. Chrome 72]
|
||||||
|
- EasyMDE version: [e.g. 2.5.1]
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Add any other context about the problem here.
|
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
name: Feature request
|
||||||
|
about: Suggest an idea for this project
|
||||||
|
title: ''
|
||||||
|
labels: Feature
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Is your feature request related to a problem? Please describe.**
|
||||||
|
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||||
|
|
||||||
|
**Describe the solution you'd like**
|
||||||
|
A clear and concise description of what you want to happen.
|
||||||
|
|
||||||
|
**Describe alternatives you've considered**
|
||||||
|
A clear and concise description of any alternative solutions or features you've considered.
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Add any other context or screenshots/mock-ups about the feature request here.
|
11
.github/ISSUE_TEMPLATE/question.md
vendored
Normal file
11
.github/ISSUE_TEMPLATE/question.md
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
name: Question
|
||||||
|
about: Ask a question if anything is unclear
|
||||||
|
title: ''
|
||||||
|
labels: Question
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Describe your question**
|
||||||
|
Please describe your question in as much detail as possible.
|
@ -283,7 +283,7 @@ horizontal-rule | drawHorizontalRule | Insert Horizontal Line<br>fa fa-minus
|
|||||||
preview | togglePreview | Toggle Preview<br>fa fa-eye no-disable
|
preview | togglePreview | Toggle Preview<br>fa fa-eye no-disable
|
||||||
side-by-side | toggleSideBySide | Toggle Side by Side<br>fa fa-columns no-disable no-mobile
|
side-by-side | toggleSideBySide | Toggle Side by Side<br>fa fa-columns no-disable no-mobile
|
||||||
fullscreen | toggleFullScreen | Toggle Fullscreen<br>fa fa-arrows-alt no-disable no-mobile
|
fullscreen | toggleFullScreen | Toggle Fullscreen<br>fa fa-arrows-alt no-disable no-mobile
|
||||||
guide | [This link](https://simplemde.com/markdown-guide) | Markdown Guide<br>fa fa-question-circle
|
guide | [This link](https://www.markdownguide.org/basic-syntax/) | Markdown Guide<br>fa fa-question-circle
|
||||||
|
|
||||||
|
|
||||||
### Toolbar customization
|
### Toolbar customization
|
||||||
|
@ -22,9 +22,9 @@
|
|||||||
"url": "https://github.com/ionaru/easy-markdown-editor/issues"
|
"url": "https://github.com/ionaru/easy-markdown-editor/issues"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"codemirror": "^5.42.2",
|
"codemirror": "^5.43.0",
|
||||||
"codemirror-spell-checker": "1.1.2",
|
"codemirror-spell-checker": "1.1.2",
|
||||||
"marked": "^0.6.0"
|
"marked": "^0.6.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/codemirror": "0.0.72",
|
"@types/codemirror": "0.0.72",
|
||||||
@ -36,7 +36,7 @@
|
|||||||
"gulp-header": "^2.0.7",
|
"gulp-header": "^2.0.7",
|
||||||
"gulp-rename": "^1.4.0",
|
"gulp-rename": "^1.4.0",
|
||||||
"gulp-uglify": "^3.0.1",
|
"gulp-uglify": "^3.0.1",
|
||||||
"typescript": "^3.2.2",
|
"typescript": "^3.3.3",
|
||||||
"vinyl-buffer": "^1.0.0",
|
"vinyl-buffer": "^1.0.0",
|
||||||
"vinyl-source-stream": "^2.0.0"
|
"vinyl-source-stream": "^2.0.0"
|
||||||
},
|
},
|
||||||
|
@ -113,9 +113,9 @@ function fixShortcut(name) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create icon element for toolbar.
|
* Create button element for toolbar.
|
||||||
*/
|
*/
|
||||||
function createIcon(options, enableTooltips, shortcuts) {
|
function createToolbarButton(options, enableTooltips, shortcuts) {
|
||||||
options = options || {};
|
options = options || {};
|
||||||
var el = document.createElement('button');
|
var el = document.createElement('button');
|
||||||
el.className = options.name;
|
el.className = options.name;
|
||||||
@ -139,11 +139,28 @@ function createIcon(options, enableTooltips, shortcuts) {
|
|||||||
el.classList.add('no-mobile');
|
el.classList.add('no-mobile');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Provide backwards compatibility with simple-markdown-editor by adding custom classes to the button.
|
||||||
|
var classNameParts = options.className.split(' ');
|
||||||
|
var iconClasses = [];
|
||||||
|
for (var classNameIndex = 0; classNameIndex < classNameParts.length; classNameIndex++) {
|
||||||
|
var classNamePart = classNameParts[classNameIndex];
|
||||||
|
// Split icon classes from the button.
|
||||||
|
// Regex will detect "fa", "fas", "fa-something" and "fa-some-icon-1", but not "fanfare".
|
||||||
|
if (classNamePart.match(/^fa([srlb]|(-[\w-]*)|$)/)) {
|
||||||
|
iconClasses.push(classNamePart);
|
||||||
|
} else {
|
||||||
|
el.classList.add(classNamePart);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
el.tabIndex = -1;
|
el.tabIndex = -1;
|
||||||
|
|
||||||
// Create icon element and append as a child to the button
|
// Create icon element and append as a child to the button
|
||||||
var icon = document.createElement('i');
|
var icon = document.createElement('i');
|
||||||
icon.className = options.className;
|
for (var iconClassIndex = 0; iconClassIndex < iconClasses.length; iconClassIndex++) {
|
||||||
|
var iconClass = iconClasses[iconClassIndex];
|
||||||
|
icon.classList.add(iconClass);
|
||||||
|
}
|
||||||
el.appendChild(icon);
|
el.appendChild(icon);
|
||||||
|
|
||||||
return el;
|
return el;
|
||||||
@ -1964,7 +1981,7 @@ EasyMDE.prototype.createToolbar = function (items) {
|
|||||||
if (item === '|') {
|
if (item === '|') {
|
||||||
el = createSep();
|
el = createSep();
|
||||||
} else {
|
} else {
|
||||||
el = createIcon(item, self.options.toolbarTips, self.options.shortcuts);
|
el = createToolbarButton(item, self.options.toolbarTips, self.options.shortcuts);
|
||||||
}
|
}
|
||||||
|
|
||||||
// bind events, special for info
|
// bind events, special for info
|
||||||
|
2
types/easymde.d.ts
vendored
2
types/easymde.d.ts
vendored
@ -82,6 +82,8 @@ declare namespace EasyMDE {
|
|||||||
action: string | ((editor: EasyMDE) => void);
|
action: string | ((editor: EasyMDE) => void);
|
||||||
className: string;
|
className: string;
|
||||||
title: string;
|
title: string;
|
||||||
|
noDisable?: boolean;
|
||||||
|
noMobile?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Options {
|
interface Options {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user