Property WriteDirectionAttribute
WriteDirectionAttribute
Gets or sets a value indicating whether right-to-left content is marked with the HTML
dir attribute instead of the CSS direction property. False by default.
public bool WriteDirectionAttribute { get; set; }
Property Value
Remarks
This exists because EPUB rejects the alternative. EPUB 3 forbids direction
(and unicode-bidi) in a content document's styles outright and requires
directionality to be expressed as markup, so an otherwise valid publication containing
one Arabic paragraph fails validation with CSS-001. It is off by default because
turning it on changes the bytes of every HTML export of a bidirectional document, and
plain HTML has no such rule.
The attribute is the better markup either way — it survives a stylesheet being stripped, and it is what the HTML specification itself recommends — so a caller exporting HTML for the web may reasonably turn it on too.