HTMLUtils
Import :
const HTMLUtils = brackets.getModule("language/HTMLUtils")
TAG_NAME : string
Key representing tag name
Kind: global constant
CLOSING_TAG : string
Key representing closing tag
Kind: global constant
ATTR_NAME : string
Key representing attribute name
Kind: global constant
ATTR_VALUE : string
Key representing attribute value
Kind: global constant
getTagAttributes(editor, pos) ⇒ Array.<string>
Compiles a list of used attributes for a given tag.
Kind: global function
Returns: Array.<string>
- - A list of the used attributes within the current tag.
Param | Type | Description |
---|---|---|
editor | CodeMirror | An instance of a CodeMirror editor. |
pos | Object | The position in the CodeMirror editor, specified by character and line numbers. |
createTagInfo([tokenType], [offset], [tagName], [attrName], [attrValue]) ⇒ Object
Creates a tagInfo object and assures all the values are entered or are empty strings
Kind: global function
Returns: Object
- A tagInfo object with some context about the current tag hint.
Param | Type | Description |
---|---|---|
[tokenType] | string | what is getting edited and should be hinted |
[offset] | number | where the cursor is for the part getting hinted |
[tagName] | string | The name of the tag |
[attrName] | string | The name of the attribute |
[attrValue] | string | The value of the attribute |
getTagInfo(editor, constPos, let) ⇒ Object
Figure out if we're in a tag, and if we are return info about it An example token stream for this tag is
<span id="open-files-disclosure-arrow"></span> :
className:tag string:"<span"
className: string:" "
className:attribute string:"id"
className: string:"="
className:string string:""open-files-disclosure-arrow""
className:tag string:"></span>"
Kind: global function
Returns: Object
- A tagInfo object with some context about the current tag hint.
Param | Type | Description |
---|---|---|
editor | Editor | An instance of a Brackets editor |
constPos | Object | A CM pos (likely from editor.getCursorPos()) |
let | isHtmlMode:boolean | the module know we are in html mode |
findBlocks(editor, modeName) ⇒ Object
Returns an Array of info about all blocks whose token mode name matches that passed in, in the given Editor's HTML document (assumes the Editor contains HTML text).
Kind: global function
Returns: Object
- Array
Param | Type | Description |
---|---|---|
editor | Editor | the editor containing the HTML text |
modeName | string | the mode name of the tokens to look for |
findStyleBlocks(editor) ⇒ Object
Returns an Array of info about all 'style' blocks in the given Editor's HTML document (assumes the Editor contains HTML text).
Kind: global function
Returns: Object
- Array
Param | Type |
---|---|
editor | Editor |