1- <!doctype html>
1+ <!doctype html>
22
33< title > CodeMirror: User Manual</ title >
44< meta charset ="utf-8 "/>
6969< section class =first id =overview >
7070 < h2 style ="position: relative ">
7171 User manual and reference guide
72- < span style ="color: #888; font-size: 1rem; position: absolute; right: 0; bottom: 0 "> version 5.13.1 </ span >
72+ < span style ="color: #888; font-size: 1rem; position: absolute; right: 0; bottom: 0 "> version 5.13.5 </ span >
7373 </ h2 >
7474
7575 < p > CodeMirror is a code-editor component that can be embedded in
@@ -1254,7 +1254,7 @@ <h3 id="api_selection">Cursor and selection methods</h3>
12541254 separator to put between the lines in the output. When multiple
12551255 selections are present, they are concatenated with instances
12561256 of < code > lineSep</ code > in between.</ dd >
1257- < dt id ="getSelections "> < code > < strong > doc.getSelections</ strong > (?lineSep: string) → string</ code > </ dt >
1257+ < dt id ="getSelections "> < code > < strong > doc.getSelections</ strong > (?lineSep: string) → array< string> </ code > </ dt >
12581258 < dd > Returns an array containing a string for each selection,
12591259 representing the content of the selections.</ dd >
12601260
@@ -2064,26 +2064,29 @@ <h3 id="api_static">Static properties</h3>
20642064 else (usually one) for dev snapshots.</ dd >
20652065
20662066 < dt id ="fromTextArea "> < code > < strong > CodeMirror.fromTextArea</ strong > (textArea: TextAreaElement, ?config: object)</ code > </ dt >
2067- < dd >
2068- The method provides another way to initialize an editor. It
2069- takes a textarea DOM node as first argument and an optional
2070- configuration object as second. It will replace the textarea
2071- with a CodeMirror instance, and wire up the form of that
2072- textarea (if any) to make sure the editor contents are put
2073- into the textarea when the form is submitted. The text in the
2074- textarea will provide the content for the editor. A CodeMirror
2075- instance created this way has three additional methods:
2076- < dl >
2077- < dt id ="save "> < code > < strong > cm.save</ strong > ()</ code > </ dt >
2078- < dd > Copy the content of the editor into the textarea.</ dd >
2079-
2080- < dt id ="toTextArea "> < code > < strong > cm.toTextArea</ strong > ()</ code > </ dt >
2081- < dd > Remove the editor, and restore the original textarea (with
2082- the editor's current content).</ dd >
2083-
2084- < dt id ="getTextArea "> < code > < strong > cm.getTextArea</ strong > () → TextAreaElement</ code > </ dt >
2085- < dd > Returns the textarea that the instance was based on.</ dd >
2086- </ dl >
2067+ < dd > This method provides another way to initialize an editor. It
2068+ takes a textarea DOM node as first argument and an optional
2069+ configuration object as second. It will replace the textarea
2070+ with a CodeMirror instance, and wire up the form of that
2071+ textarea (if any) to make sure the editor contents are put into
2072+ the textarea when the form is submitted. The text in the
2073+ textarea will provide the content for the editor. A CodeMirror
2074+ instance created this way has three additional methods:
2075+ < dl >
2076+ < dt id ="save "> < code > < strong > cm.save</ strong > ()</ code > </ dt >
2077+ < dd > Copy the content of the editor into the textarea.</ dd >
2078+
2079+ < dt id ="toTextArea "> < code > < strong > cm.toTextArea</ strong > ()</ code > </ dt >
2080+ < dd > Remove the editor, and restore the original textarea (with
2081+ the editor's current content). If you dynamically create and
2082+ destroy editors made with `fromTextArea`, without destroying
2083+ the form they are part of, you should make sure to call
2084+ `toTextArea` to remove the editor, or its `"submit"` handler
2085+ on the form will cause a memory leak.</ dd >
2086+
2087+ < dt id ="getTextArea "> < code > < strong > cm.getTextArea</ strong > () → TextAreaElement</ code > </ dt >
2088+ < dd > Returns the textarea that the instance was based on.</ dd >
2089+ </ dl >
20872090 </ dd >
20882091
20892092 < dt id ="defaults "> < code > < strong > CodeMirror.defaults</ strong > : object</ code > </ dt >
@@ -2100,7 +2103,7 @@ <h3 id="api_static">Static properties</h3>
21002103 created from then on.</ dd >
21012104
21022105 < dt id ="defineDocExtension "> < code > < strong > CodeMirror.defineDocExtension</ strong > (name: string, value: any)</ code > </ dt >
2103- < dd > Like < a href ="#defineExtenstion "> < code > defineExtension</ code > </ a > ,
2106+ < dd > Like < a href ="#defineExtension "> < code > defineExtension</ code > </ a > ,
21042107 but the method will be added to the interface
21052108 for < a href ="#Doc "> < code > Doc</ code > </ a > objects instead.</ dd >
21062109
0 commit comments