Skip to content

Commit 46b1e23

Browse files
committed
Soft tabs option
1 parent 90b3779 commit 46b1e23

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

README.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ $('#myEditor').markdownEditor({
8080
preview: true,
8181
// This callback is called when the user click on the preview button:
8282
onPreview: function (content, callback) {
83-
83+
8484
// Example of implementation with ajax:
8585
$.ajax({
8686
url: 'preview.php',
@@ -181,6 +181,13 @@ The font size of the editor
181181

182182
The theme of the editor. See the available themes at the homepage of Ace (http://ace.c9.io)
183183

184+
#### softTabs
185+
186+
**Type**: boolean
187+
**Default**: true
188+
189+
Pass false to disable the use of soft tabs. Soft tabs means you're using spaces instead of the tab character ('\t')
190+
184191
#### fullscreen
185192

186193
**Type**: boolean

dist/css/bootstrap-markdown-editor.css

-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/bootstrap-markdown-editor.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
editor.setTheme('ace/theme/' + defaults.theme);
4848
editor.getSession().setMode('ace/mode/markdown');
4949
editor.getSession().setUseWrapMode(true);
50+
editor.getSession().setUseSoftTabs(defaults.softTabs);
5051

5152
editor.setHighlightActiveLine(false);
5253
editor.setShowPrintMargin(false);
@@ -195,8 +196,7 @@
195196

196197
editor.focus();
197198
});
198-
199-
this.editor = editor;
199+
200200
return this;
201201
},
202202
content: function () {
@@ -385,6 +385,7 @@
385385
height: '400px',
386386
fontSize: '14px',
387387
theme: 'tomorrow',
388+
softTabs: true,
388389
fullscreen: true,
389390
imageUpload: false,
390391
uploadPath: '',

0 commit comments

Comments
 (0)