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

Method getBlockHTMLAttributes

src/trix/models/html_parser.js:355–367  ·  view source on GitHub ↗
(element)

Source from the content-addressed store, hash-verified

353 }
354
355 getBlockHTMLAttributes(element) {
356 const attributes = {}
357 const blockConfig = Object.values(config.blockAttributes).find(settings => settings.tagName === tagName(element))
358 const allowedAttributes = blockConfig?.htmlAttributes || []
359
360 allowedAttributes.forEach((attribute) => {
361 if (element.hasAttribute(attribute)) {
362 attributes[attribute] = element.getAttribute(attribute)
363 }
364 })
365
366 return attributes
367 }
368
369 findBlockElementAncestors(element) {
370 const ancestors = []

Callers 2

appendBlockForElementMethod · 0.95

Calls 4

tagNameFunction · 0.90
findMethod · 0.45
hasAttributeMethod · 0.45
getAttributeMethod · 0.45

Tested by

no test coverage detected