MCPcopy Index your code
hub / github.com/basecamp/trix / replaceHTML

Method replaceHTML

src/trix/models/composition.js:142–148  ·  view source on GitHub ↗
(html)

Source from the content-addressed store, hash-verified

140 }
141
142 replaceHTML(html) {
143 const document = HTMLParser.parse(html).getDocument().copyUsingObjectsFromDocument(this.document)
144 const locationRange = this.getLocationRange({ strict: false })
145 const selectedRange = this.document.rangeFromLocationRange(locationRange)
146 this.setDocument(document)
147 return this.setSelection(selectedRange)
148 }
149
150 insertFile(file) {
151 return this.insertFiles([ file ])

Callers 2

reparseMethod · 0.80
reparseMethod · 0.80

Calls 7

getLocationRangeMethod · 0.95
setDocumentMethod · 0.95
setSelectionMethod · 0.95
getDocumentMethod · 0.45
parseMethod · 0.45

Tested by

no test coverage detected