mirror of
https://github.com/Ionaru/easy-markdown-editor
synced 2025-06-27 13:11:01 -06:00
Update editorconfig and automatic code format
This commit is contained in:
parent
dc38624378
commit
42304e8a87
@ -1,9 +1,17 @@
|
|||||||
[*]
|
# Editor configuration, see https://editorconfig.org
|
||||||
charset=utf-8
|
root = true
|
||||||
end_of_line=lf
|
|
||||||
insert_final_newline=true
|
|
||||||
indent_style=space
|
|
||||||
indent_size=4
|
|
||||||
|
|
||||||
[*.{yml,yaml}]
|
[*]
|
||||||
indent_size=2
|
charset = utf-8
|
||||||
|
end_of_line = lf
|
||||||
|
insert_final_newline = true
|
||||||
|
indent_size = 4
|
||||||
|
indent_style = space
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
|
||||||
|
[*.yaml]
|
||||||
|
indent_size = 2
|
||||||
|
|
||||||
|
[*.md]
|
||||||
|
max_line_length = off
|
||||||
|
trim_trailing_whitespace = false
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror-rtl pre {
|
.CodeMirror-rtl pre {
|
||||||
direction: rtl;
|
direction: rtl;
|
||||||
}
|
}
|
||||||
|
|
||||||
.EasyMDEContainer.sided--no-fullscreen {
|
.EasyMDEContainer.sided--no-fullscreen {
|
||||||
@ -46,8 +46,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.EasyMDEContainer.sided--no-fullscreen .CodeMirror-sided {
|
.EasyMDEContainer.sided--no-fullscreen .CodeMirror-sided {
|
||||||
border-right: none!important;
|
border-right: none !important;
|
||||||
border-bottom-right-radius: 0px;
|
border-bottom-right-radius: 0;
|
||||||
position: relative;
|
position: relative;
|
||||||
flex: 1 1 auto;
|
flex: 1 1 auto;
|
||||||
}
|
}
|
||||||
@ -364,15 +364,18 @@
|
|||||||
visibility: visible;
|
visibility: visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
span[data-img-src]::after{
|
span[data-img-src]::after {
|
||||||
content: '';
|
content: '';
|
||||||
|
/*noinspection CssUnresolvedCustomProperty, added through JS*/
|
||||||
background-image: var(--bg-image);
|
background-image: var(--bg-image);
|
||||||
display: block;
|
display: block;
|
||||||
max-height: 100%;
|
max-height: 100%;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
background-size: contain;
|
background-size: contain;
|
||||||
height: 0;
|
height: 0;
|
||||||
|
/*noinspection CssUnresolvedCustomProperty, added through JS*/
|
||||||
padding-top: var(--height);
|
padding-top: var(--height);
|
||||||
|
/*noinspection CssUnresolvedCustomProperty, added through JS*/
|
||||||
width: var(--width);
|
width: var(--width);
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
}
|
}
|
||||||
|
@ -16,8 +16,7 @@ CodeMirror.commands.tabAndIndentMarkdownList = function (cm) {
|
|||||||
|
|
||||||
if (cm.options.indentWithTabs) {
|
if (cm.options.indentWithTabs) {
|
||||||
cm.execCommand('insertTab');
|
cm.execCommand('insertTab');
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
var spaces = Array(cm.options.tabSize + 1).join(' ');
|
var spaces = Array(cm.options.tabSize + 1).join(' ');
|
||||||
cm.replaceSelection(spaces);
|
cm.replaceSelection(spaces);
|
||||||
}
|
}
|
||||||
@ -36,8 +35,7 @@ CodeMirror.commands.shiftTabAndUnindentMarkdownList = function (cm) {
|
|||||||
|
|
||||||
if (cm.options.indentWithTabs) {
|
if (cm.options.indentWithTabs) {
|
||||||
cm.execCommand('insertTab');
|
cm.execCommand('insertTab');
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
var spaces = Array(cm.options.tabSize + 1).join(' ');
|
var spaces = Array(cm.options.tabSize + 1).join(' ');
|
||||||
cm.replaceSelection(spaces);
|
cm.replaceSelection(spaces);
|
||||||
}
|
}
|
||||||
|
@ -151,7 +151,7 @@ var CLASS_REGEX = {};
|
|||||||
* @param {String} className Class name to convert to regex for matching.
|
* @param {String} className Class name to convert to regex for matching.
|
||||||
* @returns {RegExp} Regular expression option that will match className.
|
* @returns {RegExp} Regular expression option that will match className.
|
||||||
*/
|
*/
|
||||||
function getClassRegex (className) {
|
function getClassRegex(className) {
|
||||||
return CLASS_REGEX[className] || (CLASS_REGEX[className] = new RegExp('\\s*' + className + '(\\s*)', 'g'));
|
return CLASS_REGEX[className] || (CLASS_REGEX[className] = new RegExp('\\s*' + className + '(\\s*)', 'g'));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -161,7 +161,7 @@ function getClassRegex (className) {
|
|||||||
* @param {String} className Class string to apply
|
* @param {String} className Class string to apply
|
||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
function addClass (el, className) {
|
function addClass(el, className) {
|
||||||
if (!el || !className) return;
|
if (!el || !className) return;
|
||||||
var classRegex = getClassRegex(className);
|
var classRegex = getClassRegex(className);
|
||||||
if (el.className.match(classRegex)) return; // already applied
|
if (el.className.match(classRegex)) return; // already applied
|
||||||
@ -174,7 +174,7 @@ function addClass (el, className) {
|
|||||||
* @param {String} className Class string to remove
|
* @param {String} className Class string to remove
|
||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
function removeClass (el, className) {
|
function removeClass(el, className) {
|
||||||
if (!el || !className) return;
|
if (!el || !className) return;
|
||||||
var classRegex = getClassRegex(className);
|
var classRegex = getClassRegex(className);
|
||||||
if (!el.className.match(classRegex)) return; // not available to remove
|
if (!el.className.match(classRegex)) return; // not available to remove
|
||||||
@ -241,7 +241,7 @@ function createToolbarButton(options, enableActions, enableTooltips, shortcuts,
|
|||||||
|
|
||||||
// Prevent errors if there is no class name in custom options
|
// Prevent errors if there is no class name in custom options
|
||||||
var classNameParts = [];
|
var classNameParts = [];
|
||||||
if(typeof options.className !== 'undefined') {
|
if (typeof options.className !== 'undefined') {
|
||||||
classNameParts = options.className.split(' ');
|
classNameParts = options.className.split(' ');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -870,11 +870,11 @@ function afterImageUploaded(editor, url) {
|
|||||||
|
|
||||||
// Check if media is an image
|
// Check if media is an image
|
||||||
if (['png', 'jpg', 'jpeg', 'gif', 'svg'].includes(ext)) {
|
if (['png', 'jpg', 'jpeg', 'gif', 'svg'].includes(ext)) {
|
||||||
_replaceSelection(cm, stat.image, options.insertTexts.uploadedImage, url);
|
_replaceSelection(cm, stat.image, options.insertTexts.uploadedImage, url);
|
||||||
} else {
|
} else {
|
||||||
var text_link = options.insertTexts.link;
|
var text_link = options.insertTexts.link;
|
||||||
text_link[0] = '[' + imageName;
|
text_link[0] = '[' + imageName;
|
||||||
_replaceSelection(cm, stat.link, text_link, url);
|
_replaceSelection(cm, stat.link, text_link, url);
|
||||||
}
|
}
|
||||||
|
|
||||||
// show uploaded image filename for 1000ms
|
// show uploaded image filename for 1000ms
|
||||||
@ -1767,7 +1767,7 @@ function EasyMDE(options) {
|
|||||||
options.shortcuts = extend({}, shortcuts, options.shortcuts || {});
|
options.shortcuts = extend({}, shortcuts, options.shortcuts || {});
|
||||||
|
|
||||||
options.maxHeight = options.maxHeight || undefined;
|
options.maxHeight = options.maxHeight || undefined;
|
||||||
|
|
||||||
options.direction = options.direction || 'ltr';
|
options.direction = options.direction || 'ltr';
|
||||||
|
|
||||||
if (typeof options.maxHeight !== 'undefined') {
|
if (typeof options.maxHeight !== 'undefined') {
|
||||||
@ -1795,7 +1795,7 @@ function EasyMDE(options) {
|
|||||||
|
|
||||||
// If overlay mode is specified and combine is not provided, default it to true
|
// If overlay mode is specified and combine is not provided, default it to true
|
||||||
if (options.overlayMode && options.overlayMode.combine === undefined) {
|
if (options.overlayMode && options.overlayMode.combine === undefined) {
|
||||||
options.overlayMode.combine = true;
|
options.overlayMode.combine = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update this options
|
// Update this options
|
||||||
@ -1871,7 +1871,7 @@ function EasyMDE(options) {
|
|||||||
*/
|
*/
|
||||||
EasyMDE.prototype.uploadImages = function (files, onSuccess, onError) {
|
EasyMDE.prototype.uploadImages = function (files, onSuccess, onError) {
|
||||||
if (files.length === 0) {
|
if (files.length === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var names = [];
|
var names = [];
|
||||||
for (var i = 0; i < files.length; i++) {
|
for (var i = 0; i < files.length; i++) {
|
||||||
@ -1893,7 +1893,7 @@ EasyMDE.prototype.uploadImages = function (files, onSuccess, onError) {
|
|||||||
*/
|
*/
|
||||||
EasyMDE.prototype.uploadImagesUsingCustomFunction = function (imageUploadFunction, files) {
|
EasyMDE.prototype.uploadImagesUsingCustomFunction = function (imageUploadFunction, files) {
|
||||||
if (files.length === 0) {
|
if (files.length === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var names = [];
|
var names = [];
|
||||||
for (var i = 0; i < files.length; i++) {
|
for (var i = 0; i < files.length; i++) {
|
||||||
@ -1952,9 +1952,9 @@ EasyMDE.prototype.markdown = function (text) {
|
|||||||
if (hljs) {
|
if (hljs) {
|
||||||
markedOptions.highlight = function (code, language) {
|
markedOptions.highlight = function (code, language) {
|
||||||
if (language && hljs.getLanguage(language)) {
|
if (language && hljs.getLanguage(language)) {
|
||||||
return hljs.highlight(language, code).value;
|
return hljs.highlight(language, code).value;
|
||||||
} else {
|
} else {
|
||||||
return hljs.highlightAuto(code).value;
|
return hljs.highlightAuto(code).value;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -2036,13 +2036,13 @@ EasyMDE.prototype.render = function (el) {
|
|||||||
|
|
||||||
// CodeMirror overlay mode
|
// CodeMirror overlay mode
|
||||||
if (options.overlayMode) {
|
if (options.overlayMode) {
|
||||||
CodeMirror.defineMode('overlay-mode', function(config) {
|
CodeMirror.defineMode('overlay-mode', function (config) {
|
||||||
return CodeMirror.overlayMode(CodeMirror.getMode(config, options.spellChecker !== false ? 'spell-checker' : 'gfm'), options.overlayMode.mode, options.overlayMode.combine);
|
return CodeMirror.overlayMode(CodeMirror.getMode(config, options.spellChecker !== false ? 'spell-checker' : 'gfm'), options.overlayMode.mode, options.overlayMode.combine);
|
||||||
});
|
});
|
||||||
|
|
||||||
mode = 'overlay-mode';
|
mode = 'overlay-mode';
|
||||||
backdrop = options.parsingConfig;
|
backdrop = options.parsingConfig;
|
||||||
backdrop.gitHubSpice = false;
|
backdrop.gitHubSpice = false;
|
||||||
} else {
|
} else {
|
||||||
mode = options.parsingConfig;
|
mode = options.parsingConfig;
|
||||||
mode.name = 'gfm';
|
mode.name = 'gfm';
|
||||||
@ -2149,7 +2149,7 @@ EasyMDE.prototype.render = function (el) {
|
|||||||
|
|
||||||
function assignImageBlockAttributes(parentEl, img) {
|
function assignImageBlockAttributes(parentEl, img) {
|
||||||
parentEl.setAttribute('data-img-src', img.url);
|
parentEl.setAttribute('data-img-src', img.url);
|
||||||
parentEl.setAttribute('style', '--bg-image:url('+img.url+');--width:'+img.naturalWidth+'px;--height:'+calcHeight(img.naturalWidth, img.naturalHeight));
|
parentEl.setAttribute('style', '--bg-image:url(' + img.url + ');--width:' + img.naturalWidth + 'px;--height:' + calcHeight(img.naturalWidth, img.naturalHeight));
|
||||||
_vm.codemirror.setSize();
|
_vm.codemirror.setSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2158,8 +2158,8 @@ EasyMDE.prototype.render = function (el) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
easyMDEContainer.querySelectorAll('.cm-image-marker').forEach(function(e) {
|
easyMDEContainer.querySelectorAll('.cm-image-marker').forEach(function (e) {
|
||||||
var parentEl = e.parentElement;
|
var parentEl = e.parentElement;
|
||||||
if (!parentEl.innerText.match(/^!\[.*?\]\(.*\)/g)) {
|
if (!parentEl.innerText.match(/^!\[.*?\]\(.*\)/g)) {
|
||||||
// if img pasted on the same line with other text, don't preview, preview only images on separate line
|
// if img pasted on the same line with other text, don't preview, preview only images on separate line
|
||||||
return;
|
return;
|
||||||
@ -2173,9 +2173,9 @@ EasyMDE.prototype.render = function (el) {
|
|||||||
if (srcAttr && srcAttr.length >= 2) {
|
if (srcAttr && srcAttr.length >= 2) {
|
||||||
var keySrc = srcAttr[1];
|
var keySrc = srcAttr[1];
|
||||||
|
|
||||||
if (! window.EMDEimagesCache[keySrc]) {
|
if (!window.EMDEimagesCache[keySrc]) {
|
||||||
var img = document.createElement('img');
|
var img = document.createElement('img');
|
||||||
img.onload = function() {
|
img.onload = function () {
|
||||||
window.EMDEimagesCache[keySrc] = {
|
window.EMDEimagesCache[keySrc] = {
|
||||||
naturalWidth: img.naturalWidth,
|
naturalWidth: img.naturalWidth,
|
||||||
naturalHeight: img.naturalHeight,
|
naturalHeight: img.naturalHeight,
|
||||||
@ -2191,6 +2191,7 @@ EasyMDE.prototype.render = function (el) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
this.codemirror.on('update', function () {
|
this.codemirror.on('update', function () {
|
||||||
handleImages();
|
handleImages();
|
||||||
});
|
});
|
||||||
@ -2300,9 +2301,9 @@ EasyMDE.prototype.openBrowseFileWindow = function (onSuccess, onError) {
|
|||||||
imageInput.click(); //dispatchEvent(new MouseEvent('click')); // replaced with click() for IE11 compatibility.
|
imageInput.click(); //dispatchEvent(new MouseEvent('click')); // replaced with click() for IE11 compatibility.
|
||||||
function onChange(event) {
|
function onChange(event) {
|
||||||
if (self.options.imageUploadFunction) {
|
if (self.options.imageUploadFunction) {
|
||||||
self.uploadImagesUsingCustomFunction(self.options.imageUploadFunction, event.target.files);
|
self.uploadImagesUsingCustomFunction(self.options.imageUploadFunction, event.target.files);
|
||||||
} else {
|
} else {
|
||||||
self.uploadImages(event.target.files, onSuccess, onError);
|
self.uploadImages(event.target.files, onSuccess, onError);
|
||||||
}
|
}
|
||||||
imageInput.removeEventListener('change', onChange);
|
imageInput.removeEventListener('change', onChange);
|
||||||
}
|
}
|
||||||
@ -2409,8 +2410,9 @@ EasyMDE.prototype.uploadImage = function (file, onSuccess, onError) {
|
|||||||
* @param imageUploadFunction {Function} The custom function to upload the image passed in options
|
* @param imageUploadFunction {Function} The custom function to upload the image passed in options
|
||||||
* @param file {File} The image to upload, as a HTML5 File object (https://developer.mozilla.org/en-US/docs/Web/API/File).
|
* @param file {File} The image to upload, as a HTML5 File object (https://developer.mozilla.org/en-US/docs/Web/API/File).
|
||||||
*/
|
*/
|
||||||
EasyMDE.prototype.uploadImageUsingCustomFunction = function(imageUploadFunction, file) {
|
EasyMDE.prototype.uploadImageUsingCustomFunction = function (imageUploadFunction, file) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
function onSuccess(imageUrl) {
|
function onSuccess(imageUrl) {
|
||||||
afterImageUploaded(self, imageUrl);
|
afterImageUploaded(self, imageUrl);
|
||||||
}
|
}
|
||||||
@ -2451,7 +2453,7 @@ EasyMDE.prototype.setPreviewMaxHeight = function () {
|
|||||||
var wrapperMaxHeight = optionsMaxHeight + paddingTop * 2 + borderTopWidth * 2;
|
var wrapperMaxHeight = optionsMaxHeight + paddingTop * 2 + borderTopWidth * 2;
|
||||||
var previewMaxHeight = wrapperMaxHeight.toString() + 'px';
|
var previewMaxHeight = wrapperMaxHeight.toString() + 'px';
|
||||||
|
|
||||||
preview.style.height = previewMaxHeight;
|
preview.style.height = previewMaxHeight;
|
||||||
};
|
};
|
||||||
|
|
||||||
EasyMDE.prototype.createSideBySide = function () {
|
EasyMDE.prototype.createSideBySide = function () {
|
||||||
|
@ -8,7 +8,7 @@ const editor = new EasyMDE({
|
|||||||
inputStyle: 'textarea',
|
inputStyle: 'textarea',
|
||||||
shortcuts: {
|
shortcuts: {
|
||||||
drawTable: 'Cmd-Alt-T',
|
drawTable: 'Cmd-Alt-T',
|
||||||
toggleFullScreen: null
|
toggleFullScreen: null,
|
||||||
},
|
},
|
||||||
previewClass: 'my-custom-class',
|
previewClass: 'my-custom-class',
|
||||||
spellChecker: false,
|
spellChecker: false,
|
||||||
@ -16,7 +16,7 @@ const editor = new EasyMDE({
|
|||||||
console.log('FullscreenToggled', full);
|
console.log('FullscreenToggled', full);
|
||||||
},
|
},
|
||||||
theme: 'someOtherTheme',
|
theme: 'someOtherTheme',
|
||||||
minHeight: '200px'
|
minHeight: '200px',
|
||||||
});
|
});
|
||||||
|
|
||||||
// Editor functions
|
// Editor functions
|
||||||
@ -44,7 +44,7 @@ const editor2 = new EasyMDE({
|
|||||||
name: 'bold',
|
name: 'bold',
|
||||||
action: EasyMDE.toggleBold,
|
action: EasyMDE.toggleBold,
|
||||||
className: 'fa fas fa-bolt',
|
className: 'fa fas fa-bolt',
|
||||||
title: 'Bold'
|
title: 'Bold',
|
||||||
},
|
},
|
||||||
'|',
|
'|',
|
||||||
'undo',
|
'undo',
|
||||||
@ -57,7 +57,7 @@ const editor2 = new EasyMDE({
|
|||||||
className: 'fa fas fa-star',
|
className: 'fa fas fa-star',
|
||||||
title: 'A Custom Button',
|
title: 'A Custom Button',
|
||||||
noDisable: undefined,
|
noDisable: undefined,
|
||||||
noMobile: false
|
noMobile: false,
|
||||||
},
|
},
|
||||||
'|',
|
'|',
|
||||||
{
|
{
|
||||||
@ -66,7 +66,7 @@ const editor2 = new EasyMDE({
|
|||||||
className: 'fa fab fa-github',
|
className: 'fa fab fa-github',
|
||||||
title: 'A Custom Link',
|
title: 'A Custom Link',
|
||||||
noDisable: true,
|
noDisable: true,
|
||||||
noMobile: true
|
noMobile: true,
|
||||||
},
|
},
|
||||||
'preview',
|
'preview',
|
||||||
{
|
{
|
||||||
@ -80,18 +80,18 @@ const editor2 = new EasyMDE({
|
|||||||
className: 'fa fab fa-github',
|
className: 'fa fab fa-github',
|
||||||
title: 'A Custom Link',
|
title: 'A Custom Link',
|
||||||
noDisable: true,
|
noDisable: true,
|
||||||
noMobile: true
|
noMobile: true,
|
||||||
},
|
},
|
||||||
'preview',
|
'preview',
|
||||||
{
|
{
|
||||||
name: 'bold',
|
name: 'bold',
|
||||||
action: EasyMDE.toggleBold,
|
action: EasyMDE.toggleBold,
|
||||||
className: 'fa fas fa-bold',
|
className: 'fa fas fa-bold',
|
||||||
title: 'Bold'
|
title: 'Bold',
|
||||||
},
|
},
|
||||||
]
|
],
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
editor2.clearAutosavedValue();
|
editor2.clearAutosavedValue();
|
||||||
@ -112,17 +112,17 @@ const editorImages = new EasyMDE({
|
|||||||
sbOnDrop: 'Uploading...',
|
sbOnDrop: 'Uploading...',
|
||||||
sbProgress: 'Uploading... (#progress#)',
|
sbProgress: 'Uploading... (#progress#)',
|
||||||
sbOnUploaded: 'Upload complete!',
|
sbOnUploaded: 'Upload complete!',
|
||||||
sizeUnits: 'b,Kb,Mb'
|
sizeUnits: 'b,Kb,Mb',
|
||||||
},
|
},
|
||||||
errorMessages: {
|
errorMessages: {
|
||||||
noFileGiven: 'Please select a file',
|
noFileGiven: 'Please select a file',
|
||||||
typeNotAllowed: 'This file type is not allowed!',
|
typeNotAllowed: 'This file type is not allowed!',
|
||||||
fileTooLarge: 'Image too big',
|
fileTooLarge: 'Image too big',
|
||||||
importError: 'Something went oops!'
|
importError: 'Something went oops!',
|
||||||
},
|
},
|
||||||
errorCallback: errorMessage => {
|
errorCallback: errorMessage => {
|
||||||
console.error(errorMessage);
|
console.error(errorMessage);
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const editorImagesCustom = new EasyMDE({
|
const editorImagesCustom = new EasyMDE({
|
||||||
@ -141,13 +141,13 @@ const editorImagesCustom = new EasyMDE({
|
|||||||
sbOnDrop: 'Uploading...',
|
sbOnDrop: 'Uploading...',
|
||||||
sbProgress: 'Uploading... (#progress#)',
|
sbProgress: 'Uploading... (#progress#)',
|
||||||
sbOnUploaded: 'Upload complete!',
|
sbOnUploaded: 'Upload complete!',
|
||||||
sizeUnits: 'b,Kb,Mb'
|
sizeUnits: 'b,Kb,Mb',
|
||||||
},
|
},
|
||||||
errorMessages: {
|
errorMessages: {
|
||||||
noFileGiven: 'Please select a file',
|
noFileGiven: 'Please select a file',
|
||||||
typeNotAllowed: 'This file type is not allowed!',
|
typeNotAllowed: 'This file type is not allowed!',
|
||||||
fileTooLarge: 'Image too big',
|
fileTooLarge: 'Image too big',
|
||||||
importError: 'Something went oops!'
|
importError: 'Something went oops!',
|
||||||
},
|
},
|
||||||
errorCallback: errorMessage => {
|
errorCallback: errorMessage => {
|
||||||
console.error(errorMessage);
|
console.error(errorMessage);
|
||||||
@ -157,14 +157,14 @@ const editorImagesCustom = new EasyMDE({
|
|||||||
markedOptions: {
|
markedOptions: {
|
||||||
silent: true,
|
silent: true,
|
||||||
highlight(code: string, lang: string, callback?: (error: (any | undefined), code: string) => void): string {
|
highlight(code: string, lang: string, callback?: (error: (any | undefined), code: string) => void): string {
|
||||||
return 'something'
|
return 'something';
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
promptTexts: {
|
promptTexts: {
|
||||||
image: 'Insert URL'
|
image: 'Insert URL',
|
||||||
},
|
},
|
||||||
syncSideBySidePreviewScroll: true
|
syncSideBySidePreviewScroll: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
new EasyMDE({
|
new EasyMDE({
|
||||||
@ -179,10 +179,10 @@ new EasyMDE({
|
|||||||
locale: 'en-GB',
|
locale: 'en-GB',
|
||||||
format: {
|
format: {
|
||||||
month: 'long',
|
month: 'long',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
text: 'Stored: ',
|
text: 'Stored: ',
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
new EasyMDE({
|
new EasyMDE({
|
||||||
@ -199,6 +199,6 @@ new EasyMDE({
|
|||||||
'ordered-list',
|
'ordered-list',
|
||||||
'table',
|
'table',
|
||||||
'|',
|
'|',
|
||||||
'link'
|
'link',
|
||||||
]
|
],
|
||||||
});
|
});
|
||||||
|
10
types/easymde.d.ts
vendored
10
types/easymde.d.ts
vendored
@ -23,7 +23,7 @@
|
|||||||
/// <reference types="marked"/>
|
/// <reference types="marked"/>
|
||||||
|
|
||||||
interface ArrayOneOrMore<T> extends Array<T> {
|
interface ArrayOneOrMore<T> extends Array<T> {
|
||||||
0: T
|
0: T;
|
||||||
}
|
}
|
||||||
|
|
||||||
type ToolbarButton =
|
type ToolbarButton =
|
||||||
@ -161,12 +161,12 @@ declare namespace EasyMDE {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface OverlayModeOptions {
|
interface OverlayModeOptions {
|
||||||
mode: CodeMirror.Mode<any>
|
mode: CodeMirror.Mode<any>;
|
||||||
combine?: boolean
|
combine?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface SpellCheckerOptions {
|
interface SpellCheckerOptions {
|
||||||
codeMirrorInstance: CodeMirror.Editor
|
codeMirrorInstance: CodeMirror.Editor;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Options {
|
interface Options {
|
||||||
@ -221,7 +221,7 @@ declare namespace EasyMDE {
|
|||||||
promptTexts?: PromptTexts;
|
promptTexts?: PromptTexts;
|
||||||
syncSideBySidePreviewScroll?: boolean;
|
syncSideBySidePreviewScroll?: boolean;
|
||||||
|
|
||||||
overlayMode?: OverlayModeOptions
|
overlayMode?: OverlayModeOptions;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user