Skip to content

Commit 01cb7e5

Browse files
committed
Merge branch 'soft-tabs'
Conflicts: dist/css/bootstrap-markdown-editor.css
2 parents f389fff + c1255ca commit 01cb7e5

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
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',
@@ -188,6 +188,13 @@ The font size of the editor
188188

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

191+
#### softTabs
192+
193+
**Type**: boolean
194+
**Default**: true
195+
196+
Pass false to disable the use of soft tabs. Soft tabs means you're using spaces instead of the tab character ('\t')
197+
191198
#### fullscreen
192199

193200
**Type**: boolean

dist/js/bootstrap-markdown-editor.js

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

src/bootstrap-markdown-editor.js

+3-1
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);
@@ -373,7 +374,7 @@
373374
html += '</div>'; // .btn-toolbar
374375
html += '</div>'; // .md-toolbar
375376

376-
html += '<div class="md-editor">' + $('<div>').text($.trim(content)).html() + '</div>';
377+
html += '<div class="md-editor">' + $('<div>').text(content).html() + '</div>';
377378
html += '<div class="md-preview" style="display:none"></div>';
378379

379380
return html;
@@ -384,6 +385,7 @@
384385
height: '400px',
385386
fontSize: '14px',
386387
theme: 'tomorrow',
388+
softTabs: true,
387389
fullscreen: true,
388390
imageUpload: false,
389391
uploadPath: '',

0 commit comments

Comments
 (0)