Merge pull request #35898 from overleaf/dp-visual-markdown-editor-setting

[web] Track markdown editor mode separately and default to visual

GitOrigin-RevId: 7195189c683618b3e0c735f91193fb662078b558
This commit is contained in:
David
2026-09-17 11:39:45 +00:00
committed by Copybot
parent f0b9ab322f
commit b77187404b
4 changed files with 61 additions and 10 deletions
@@ -48,6 +48,9 @@ export const filterFolders = filterByType('folder')
const IMAGE_FILE_EXTENSIONS = ['png', 'jpg', 'jpeg', 'pdf', 'eps', 'svg']
// File extensions handled by the markdown visual editor.
export const MARKDOWN_FILE_EXTENSIONS = ['md', 'markdown']
export const getFileExtension = (filename: string): string | null => {
const parts = filename.split('.')
if (parts.length < 2) {
@@ -65,6 +68,11 @@ export const isSvgFile = (filename: string): boolean => {
return getFileExtension(filename) === 'svg'
}
export const isMarkdownFile = (filename: string): boolean => {
const extension = getFileExtension(filename)
return extension !== null && MARKDOWN_FILE_EXTENSIONS.includes(extension)
}
export function isImageFile(file: File) {
return hasImageExtension(file.name)
}