mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-11-03 20:36:07 +01:00 
			
		
		
		
	Improve markdown editor: width, height, preferred (#23895)
Follow #23876 1. Fine tune the heights of the editors (like before) * Auto expand the editor (increase/decrease the height) when editing 2. Remember user's last used editor (textarea/easymde) in LocalStorage, then next time the editor will be switched automatically * No need to introduce extra config option, it satisfies all users, including who prefer EasyMDE 3. Also fix the width problem of Review Panel Screenshot: <details>       </details> --------- Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
		@@ -44,6 +44,11 @@ async function initRepoWikiFormEditor() {
 | 
			
		||||
  renderEasyMDEPreview();
 | 
			
		||||
 | 
			
		||||
  editor = await initComboMarkdownEditor($editorContainer, {
 | 
			
		||||
    useScene: 'wiki',
 | 
			
		||||
    // EasyMDE has some problems of height definition, it has inline style height 300px by default, so we also use inline styles to override it.
 | 
			
		||||
    // And another benefit is that we only need to write the style once for both editors.
 | 
			
		||||
    // TODO: Move height style to CSS after EasyMDE removal.
 | 
			
		||||
    editorHeights: {minHeight: '300px', height: 'calc(100vh - 600px)'},
 | 
			
		||||
    previewMode: 'gfm',
 | 
			
		||||
    previewWiki: true,
 | 
			
		||||
    easyMDEOptions: {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user