File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -236,11 +236,15 @@ export default class CodeEditor extends React.Component {
236
236
[ translateHotkey ( hotkey . prettifyMarkdown ) ] : cm => {
237
237
// Default / User configured prettier options
238
238
const currentConfig = JSON . parse ( self . props . prettierConfig )
239
- // Get current cursor position.
239
+
240
+ // Parser type will always need to be markdown so we override the option before use
241
+ currentConfig . parser = 'markdown'
242
+
243
+ // Get current cursor position
240
244
const cursorPos = cm . getCursor ( )
241
245
currentConfig . cursorOffset = cm . doc . indexFromPos ( cursorPos )
242
246
243
- // Prettify contents of editor.
247
+ // Prettify contents of editor
244
248
const formattedTextDetails = prettier . formatWithCursor ( cm . doc . getValue ( ) , currentConfig )
245
249
246
250
const formattedText = formattedTextDetails . formatted
Original file line number Diff line number Diff line change @@ -71,8 +71,7 @@ export const DEFAULT_CONFIG = {
71
71
"trailingComma": "es5",
72
72
"tabWidth": 4,
73
73
"semi": false,
74
- "singleQuote": true,
75
- "parser":"markdown"
74
+ "singleQuote": true
76
75
}`
77
76
78
77
} ,
You can’t perform that action at this time.
0 commit comments