Get DOM element from marked text #2707
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I've used doc.markText() to mark a specific variable in my CodeMirror. How can I get the DOM element for this mark? I've been looking through the mark object returned by
markText()and I haven't noticed any method or attribute.At this point I've saved the mark to be globally accessible. I'm wondering if I Code Mirror has something like
window.myEditor.marks[i].getDOMElement(). Thanks!I worked around this by setting
titleto something like 'HAX' and then finding the span via jQuery with$('span[title="HAX"]'). Seems like a missing feature although perhaps it's intentional to avoid add-ons that rely on manual DOM manipulation.I would be more than happy to get the DOM element from
cursorActivityevent in the codemirror object aslastElementClicked.