$setDirectionFromDOM
functionReads the `dir` attribute from a DOM element and applies it to the given ElementNode via ElementNode.setDirection when it is a valid direction value (`'ltr'` or `'rtl'`). Other values, including missing or empty `dir`, leave the node unchanged. Useful inside `importDOM` converters to preserve explicit text direction from imported HTML.
Import
import { $setDirectionFromDOM } from '@modular/sdk/editor';Notes
- returns
- The node, with its direction set when the source `dir` was valid.