MarkdownEditView
Defined in: obsidian.d.ts:2276
This is the editor for Obsidian Mobile as well as the upcoming WYSIWYG editor.
Extends
Implements
Constructors
new MarkdownEditView()
new MarkdownEditView(
view
):MarkdownEditView
Defined in: obsidian.d.ts:2287
Parameters
view
Returns
Properties
_children
_children:
Component
[]
Defined in: src/obsidian/augmentations/Components/Component.d.ts:9
Child Components attached to current component, will be unloaded on unloading parent component
Inherited from
MarkdownScrollableEditView
._children
_events
_events:
EventRef
[]
Defined in: src/obsidian/augmentations/Components/Component.d.ts:13
Events that are attached to the current component, will be detached on unloading parent component
Inherited from
MarkdownScrollableEditView
._events
_loaded
_loaded:
boolean
Defined in: src/obsidian/augmentations/Components/Component.d.ts:17
Whether the component and its children are loaded
Inherited from
MarkdownScrollableEditView
._loaded
app
app:
App
Defined in: obsidian.d.ts:2279
Implementation of
Inherited from
MarkdownScrollableEditView
.app
cleanupLivePreview
cleanupLivePreview:
null
| () =>void
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:30
Callback to clear all elements
Inherited from
MarkdownScrollableEditView
.cleanupLivePreview
clipboardManager
clipboardManager:
ClipBoardManager
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:34
Manager that handles pasting text, html and images into the editor
Inherited from
MarkdownScrollableEditView
.clipboardManager
cm
cm:
EditorView
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:38
Codemirror editor instance
Inherited from
cmInit
cmInit:
boolean
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:42
Whether CodeMirror is initialized
Inherited from
MarkdownScrollableEditView
.cmInit
containerEl
containerEl:
HTMLElement
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:46
Container element of the editor view
Inherited from
MarkdownScrollableEditView
.containerEl
cssClasses
cssClasses: []
Defined in: src/obsidian/internals/MarkdownScrollableEditView.d.ts:12
List of CSS classes applied to the editor
Inherited from
MarkdownScrollableEditView
.cssClasses
cursorPopupEl
cursorPopupEl:
null
|HTMLElement
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:50
Popup element for internal link
Inherited from
MarkdownScrollableEditView
.cursorPopupEl
editor?
optional
editor:Editor
Defined in: obsidian.d.ts:2337
Implementation of
Inherited from
MarkdownScrollableEditView
.editor
editorEl
editorEl:
HTMLElement
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:60
Element in which the CodeMirror editor resides
Inherited from
MarkdownScrollableEditView
.editorEl
editorSuggest
editorSuggest:
EditorSuggests
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:64
Editor suggester for autocompleting files, links, aliases, etc.
Inherited from
MarkdownScrollableEditView
.editorSuggest
hoverPopover
hoverPopover:
HoverPopover
Defined in: obsidian.d.ts:2282
Implementation of
Inherited from
isScrolling
isScrolling:
boolean
Defined in: src/obsidian/internals/MarkdownScrollableEditView.d.ts:16
Whether the editor is currently scrolling
Inherited from
MarkdownScrollableEditView
.isScrolling
livePreviewPlugin
livePreviewPlugin:
Extension
[]
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:68
The CodeMirror plugins that handle the rendering of, and interaction with Obsidian’s Markdown
Inherited from
MarkdownScrollableEditView
.livePreviewPlugin
localExtensions
localExtensions:
Extension
[]
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:72
Local (always active) extensions for the editor
Inherited from
MarkdownScrollableEditView
.localExtensions
metadataEditor?
optional
metadataEditor:MetadataEditor
Defined in: src/obsidian/augmentations/MarkdownFileInfo.d.ts:5
Implementation of
MarkdownFileInfo
.metadataEditor
Inherited from
MarkdownFileInfo
.metadataEditor
owner
owner:
MarkdownFileInfo
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:76
Controller of the editor view
Inherited from
MarkdownScrollableEditView
.owner
propertiesExtension
propertiesExtension:
Extension
[]
Defined in: src/obsidian/augmentations/MarkdownEditView.d.ts:13
Frontmatter editor extension for the editor
scope
scope:
undefined
|Scope
Defined in: src/obsidian/internals/MarkdownScrollableEditView.d.ts:20
Scope for the search component, if exists
Inherited from
MarkdownScrollableEditView
.scope
search
search:
EditorSearchComponent
Defined in: src/obsidian/internals/MarkdownScrollableEditView.d.ts:24
Search component for the editor, provides highlight and search functionality
Inherited from
MarkdownScrollableEditView
.search
sizerEl
sizerEl:
HTMLElement
Defined in: src/obsidian/internals/MarkdownScrollableEditView.d.ts:28
Container for the editor, handles editor size
Inherited from
MarkdownScrollableEditView
.sizerEl
sourceMode
sourceMode:
boolean
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:80
Whether live preview rendering is disabled
Inherited from
MarkdownScrollableEditView
.sourceMode
tableCell
tableCell:
null
|TableCellEditor
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:84
Reference to editor attached to table cell, if any
Inherited from
MarkdownScrollableEditView
.tableCell
type
type:
"source"
Defined in: src/obsidian/augmentations/MarkdownEditView.d.ts:17
Editing mode of the editor
view
view:
MarkdownView
Defined in: src/obsidian/augmentations/MarkdownEditView.d.ts:21
View the source view editor is attached to
Accessors
activeCM
Get Signature
get activeCM():
EditorView
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:88
Currently active CM instance (table cell CM or main CM)
Returns
EditorView
Inherited from
MarkdownScrollableEditView
.activeCM
file
Get Signature
get file():
TFile
Defined in: node_modules/obsidian/obsidian.d.ts:2303
Returns
Implementation of
Inherited from
MarkdownScrollableEditView
.file
path
Get Signature
get path():
string
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:96
Returns path of the attached file
Returns
string
Inherited from
MarkdownScrollableEditView
.path
Methods
addChild()
addChild<
T
>(component
):T
Defined in: obsidian.d.ts:887
Adds a child component, loading it if this component is loaded
Type Parameters
• T extends Component
Parameters
component
T
Returns
T
Inherited from
MarkdownScrollableEditView
.addChild
applyFoldInfo()
applyFoldInfo(
info
):void
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:101
Apply fold history to editor
Parameters
info
Returns
void
Inherited from
MarkdownScrollableEditView
.applyFoldInfo
applyScroll()
applyScroll(
scroll
):void
Defined in: obsidian.d.ts:2317
Parameters
scroll
number
Returns
void
Implementation of
Inherited from
MarkdownScrollableEditView
.applyScroll
beforeUnload()
beforeUnload():
void
Defined in: src/obsidian/augmentations/MarkdownEditView.d.ts:26
Save functionality to execute before editor view unload
Returns
void
buildLocalExtensions()
buildLocalExtensions():
Extension
[]
Defined in: src/obsidian/internals/MarkdownScrollableEditView.d.ts:39
Constructs local (always active) extensions for the editor
Returns
Extension
[]
Inherited from
MarkdownScrollableEditView
.buildLocalExtensions
clear()
Call Signature
clear():
void
Defined in: obsidian.d.ts:2292
Returns
void
Inherited from
MarkdownScrollableEditView
.clear
Call Signature
clear():
void
Defined in: src/obsidian/augmentations/MarkdownEditView.d.ts:30
Clear the editor view
Returns
void
destroy()
destroy():
void
Defined in: src/obsidian/augmentations/MarkdownEditView.d.ts:34
Destroy/Detach the editor view
Returns
void
Inherited from
MarkdownScrollableEditView
.destroy
destroyTableCell()
destroyTableCell(
cell
?):void
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:119
Removes specified tablecell
Parameters
cell?
Returns
void
Inherited from
MarkdownScrollableEditView
.destroyTableCell
editTableCell()
editTableCell(
cell
,new_cell
):TableCellEditor
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:123
Edit a specified table cell, creating a table cell editor
Parameters
cell
new_cell
Returns
Inherited from
MarkdownScrollableEditView
.editTableCell
focus()
focus():
void
Defined in: src/obsidian/internals/MarkdownScrollableEditView.d.ts:43
Focus the editor (and for mobile: render keyboard)
Returns
void
Inherited from
MarkdownScrollableEditView
.focus
get()
get():
string
Defined in: obsidian.d.ts:2296
Returns
string
Implementation of
Inherited from
MarkdownScrollableEditView
.get
getDynamicExtensions()
getDynamicExtensions():
Extension
[]
Defined in: src/obsidian/augmentations/MarkdownEditView.d.ts:40
Constructs extensions for the editor based on user settings
Returns
Extension
[]
Inherited from
MarkdownScrollableEditView
.getDynamicExtensions
getEphemeralState()
getEphemeralState(
state
):object
Defined in: src/obsidian/augmentations/MarkdownEditView.d.ts:44
Gets the ephemeral (non-persistent) state of the editor
Parameters
state
unknown
Returns
object
cursor
cursor:
EditorRange
getFoldInfo()
getFoldInfo():
null
|FoldInfo
Defined in: src/obsidian/augmentations/MarkdownEditView.d.ts:48
Get the current folds of the editor
Returns
null
| FoldInfo
Inherited from
MarkdownScrollableEditView
.getFoldInfo
getLocalExtensions()
getLocalExtensions():
unknown
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:143
Builds all local extensions and assigns to this.localExtensions
Returns
unknown
Inherited from
MarkdownScrollableEditView
.getLocalExtensions
getScroll()
getScroll():
number
Defined in: obsidian.d.ts:2313
Returns
number
Implementation of
Inherited from
MarkdownScrollableEditView
.getScroll
getSelection()
Call Signature
getSelection():
string
Defined in: obsidian.d.ts:2308
Returns
string
Call Signature
getSelection():
string
Defined in: src/obsidian/augmentations/MarkdownEditView.d.ts:52
Get the main selected range as string
Returns
string
handleScroll()
handleScroll():
void
Defined in: src/obsidian/internals/MarkdownScrollableEditView.d.ts:58
Invokes onMarkdownScroll on scroll
Returns
void
Inherited from
MarkdownScrollableEditView
.handleScroll
hide()
hide():
void
Defined in: src/obsidian/internals/MarkdownScrollableEditView.d.ts:62
Hides the editor (sets display: none)
Returns
void
Inherited from
MarkdownScrollableEditView
.hide
highlightSearchMatches()
highlightSearchMatches(
ranges
,style
?,remove_previous
?,range
?):void
Defined in: src/obsidian/augmentations/MarkdownEditView.d.ts:58
Add highlights for specified ranges
Parameters
ranges
style?
"is-flashing"
| "obsidian-search-match-highlight"
remove_previous?
boolean
range?
Returns
void
load()
load():
void
Defined in: obsidian.d.ts:865
Load this component and its children
Returns
void
Inherited from
MarkdownScrollableEditView
.load
onContextMenu()
onContextMenu(
event
,x
):Promise
<void
>
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:147
Creates menu on right mouse click
Parameters
event
x
boolean
Returns
Promise
<void
>
Inherited from
MarkdownScrollableEditView
.onContextMenu
onCssChange()
onCssChange():
void
Defined in: src/obsidian/internals/MarkdownScrollableEditView.d.ts:66
Clear editor cache and refreshes editor on app css change
Returns
void
Inherited from
MarkdownScrollableEditView
.onCssChange
onEditorClick()
onEditorClick(
event
,element
?):void
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:151
Execute click functionality on token on mouse click
Parameters
event
element?
Returns
void
Inherited from
MarkdownScrollableEditView
.onEditorClick
onEditorDragStart()
onEditorDragStart(
event
):void
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:157
Execute drag functionality on drag start
Parameters
event
Returns
void
Inherited from
MarkdownScrollableEditView
.onEditorDragStart
onEditorLinkMouseover()
onEditorLinkMouseover(
event
,target
):void
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:161
Execute hover functionality on mouse over event
Parameters
event
target
Returns
void
Inherited from
MarkdownScrollableEditView
.onEditorLinkMouseover
onload()
onload():
void
Defined in: obsidian.d.ts:871
Override this to load your component
Returns
void
Inherited from
MarkdownScrollableEditView
.onload
onMenu()
onMenu(
event
):void
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:167
Execute context menu functionality on right mouse click
Parameters
event
Returns
void
Inherited from
MarkdownScrollableEditView
.onMenu
onResize()
onResize():
void
Defined in: src/obsidian/internals/MarkdownScrollableEditView.d.ts:70
Update editor size and bottom padding on resize
Returns
void
Inherited from
MarkdownScrollableEditView
.onResize
onScroll()
onScroll():
void
Defined in: src/obsidian/internals/MarkdownScrollableEditView.d.ts:74
Update editor suggest position and invokes handleScroll on scroll
Returns
void
Inherited from
MarkdownScrollableEditView
.onScroll
onunload()
onunload():
void
Defined in: obsidian.d.ts:882
Override this to unload your component
Returns
void
Inherited from
MarkdownScrollableEditView
.onunload
onUpdate()
onUpdate(
update
,changed
):void
Defined in: src/obsidian/augmentations/MarkdownEditView.d.ts:67
Execute functionality on CM editor state update
Parameters
update
ViewUpdate
changed
boolean
Returns
void
Inherited from
MarkdownScrollableEditView
.onUpdate
onViewClick()
onViewClick(
event
?):void
Defined in: src/obsidian/internals/MarkdownScrollableEditView.d.ts:82
Close editor suggest and removes highlights on click
Parameters
event?
Returns
void
Inherited from
MarkdownScrollableEditView
.onViewClick
register()
register(
cb
):void
Defined in: obsidian.d.ts:897
Registers a callback to be called when unloading
Parameters
cb
() => any
Returns
void
Inherited from
MarkdownScrollableEditView
.register
registerDomEvent()
Call Signature
registerDomEvent<
K
>(el
,type
,callback
,options
?):void
Defined in: obsidian.d.ts:907
Registers an DOM event to be detached when unloading
Type Parameters
• K extends keyof WindowEventMap
Parameters
el
type
K
callback
(this
, ev
) => any
options?
boolean
| AddEventListenerOptions
Returns
void
Inherited from
MarkdownScrollableEditView
.registerDomEvent
Call Signature
registerDomEvent<
K
>(el
,type
,callback
,options
?):void
Defined in: obsidian.d.ts:912
Registers an DOM event to be detached when unloading
Type Parameters
• K extends keyof DocumentEventMap
Parameters
el
type
K
callback
(this
, ev
) => any
options?
boolean
| AddEventListenerOptions
Returns
void
Inherited from
MarkdownScrollableEditView
.registerDomEvent
Call Signature
registerDomEvent<
K
>(el
,type
,callback
,options
?):void
Defined in: obsidian.d.ts:917
Registers an DOM event to be detached when unloading
Type Parameters
• K extends keyof HTMLElementEventMap
Parameters
el
type
K
callback
(this
, ev
) => any
options?
boolean
| AddEventListenerOptions
Returns
void
Inherited from
MarkdownScrollableEditView
.registerDomEvent
registerEvent()
registerEvent(
eventRef
):void
Defined in: obsidian.d.ts:902
Registers an event to be detached when unloading
Parameters
eventRef
Returns
void
Inherited from
MarkdownScrollableEditView
.registerEvent
registerInterval()
registerInterval(
id
):number
Defined in: obsidian.d.ts:924
Registers an interval (from setInterval) to be cancelled when unloading Use setInterval instead of setInterval to avoid TypeScript confusing between NodeJS vs Browser API
Parameters
id
number
Returns
number
Inherited from
MarkdownScrollableEditView
.registerInterval
registerScopeEvent()
registerScopeEvent(
keymapEventHandler
):void
Defined in: src/obsidian/augmentations/Components/Component.d.ts:19
Parameters
keymapEventHandler
Returns
void
Inherited from
MarkdownScrollableEditView
.registerScopeEvent
reinit()
reinit():
void
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:179
Reinitialize the editor inside new container
Returns
void
Inherited from
MarkdownScrollableEditView
.reinit
removeChild()
removeChild<
T
>(component
):T
Defined in: obsidian.d.ts:892
Removes a child component, unloading it
Type Parameters
• T extends Component
Parameters
component
T
Returns
T
Inherited from
MarkdownScrollableEditView
.removeChild
reparent()
reparent(
new_container
):void
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:183
Move the editor into the new container
Parameters
new_container
Returns
void
Inherited from
MarkdownScrollableEditView
.reparent
requestOnInternalDataChange()
requestOnInternalDataChange():
void
Defined in: src/obsidian/augmentations/MarkdownEditView.d.ts:71
Debounced onInternalDataChange of view
Returns
void
requestSaveFolds()
requestSaveFolds():
unknown
Defined in: src/obsidian/augmentations/MarkdownEditView.d.ts:75
Debounced onMarkdownFold of view
Returns
unknown
resetSyntaxHighlighting()
resetSyntaxHighlighting():
void
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:189
Bodge to reset the syntax highlighting
Returns
void
Inherited from
MarkdownScrollableEditView
.resetSyntaxHighlighting
set()
Call Signature
set(
data
,clear
):void
Defined in: obsidian.d.ts:2300
Parameters
data
string
clear
boolean
Returns
void
Implementation of
Inherited from
MarkdownScrollableEditView
.set
Call Signature
set(
data
,clear
):void
Defined in: src/obsidian/augmentations/MarkdownEditView.d.ts:79
Set the state of the editor
Parameters
data
string
clear
boolean
Returns
void
Implementation of
MarkdownSubView.set
setCssClass()
setCssClass(
classes
):void
Defined in: src/obsidian/internals/MarkdownScrollableEditView.d.ts:86
Add classes to the editor, functions as a toggle
Parameters
classes
string
[]
Returns
void
Inherited from
MarkdownScrollableEditView
.setCssClass
setEphemeralState()
setEphemeralState(
state
):void
Defined in: src/obsidian/augmentations/MarkdownEditView.d.ts:83
Set the ephemeral (non-persistent) state of the editor
Parameters
state
unknown
Returns
void
setHighlight()
setHighlight(
match
):void
Defined in: src/obsidian/augmentations/MarkdownEditView.d.ts:87
Set highlight of any search match
Parameters
match
endLoc
number
focus
boolean
line
number
match
unknown
startLoc
number
Returns
void
setState()
setState(
state
):void
Defined in: src/obsidian/augmentations/MarkdownEditView.d.ts:97
Set the state of the editor (applies selections, scrolls, …)
Parameters
state
unknown
Returns
void
show()
show():
void
Defined in: src/obsidian/augmentations/MarkdownEditView.d.ts:101
Render the editor and the metadata-editor element
Returns
void
Inherited from
MarkdownScrollableEditView
.show
showSearch()
showSearch(
replace
):void
Defined in: src/obsidian/internals/MarkdownScrollableEditView.d.ts:94
Reveal the search (and replace) component
Parameters
replace
boolean
Returns
void
Inherited from
MarkdownScrollableEditView
.showSearch
toggleFoldFrontmatter()
toggleFoldFrontmatter():
void
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:199
Enables/disables frontmatter folding
Returns
void
Inherited from
MarkdownScrollableEditView
.toggleFoldFrontmatter
toggleSource()
toggleSource():
void
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:203
Toggle source mode for editor and dispatch effect
Returns
void
Inherited from
MarkdownScrollableEditView
.toggleSource
triggerClickableToken()
triggerClickableToken(
token
,new_leaf
):void
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:207
Execute functionality of token (open external link, open internal link in leaf, …)
Parameters
token
new_leaf
boolean
Returns
void
Inherited from
MarkdownScrollableEditView
.triggerClickableToken
unload()
unload():
void
Defined in: obsidian.d.ts:876
Unload this component and its children
Returns
void
Inherited from
MarkdownScrollableEditView
.unload
updateBottomPadding()
updateBottomPadding(
height
):void
Defined in: src/obsidian/augmentations/MarkdownEditView.d.ts:105
Update the bottom padding of the CodeMirror contentdom (based on backlinksEl)
Parameters
height
number
Returns
void
Inherited from
MarkdownScrollableEditView
.updateBottomPadding
updateLinkPopup()
updateLinkPopup():
void
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:213
In mobile, creates a popover link on clickable token, if exists
Returns
void
Inherited from
MarkdownScrollableEditView
.updateLinkPopup
updateOptions()
updateOptions():
void
Defined in: src/obsidian/augmentations/MarkdownEditView.d.ts:109
Update options of the editor from settings
Returns
void