Class Bdi


@Bean(typeName="bdi") public class Bdi extends HtmlElementText
DTO for an HTML <bdi> element.

The bdi element represents a span of text that is to be isolated from its surroundings for the purposes of bidirectional text formatting. It is used to handle text that might be in a different direction than the surrounding text, such as user-generated content in a different language or script. The bdi element ensures that the text inside it is formatted correctly regardless of the directionality of the surrounding content.

Examples:

import static org.apache.juneau.bean.html5.HtmlBuilder.*; // User comment in Arabic Bdi arabic = bdi("مرحبا بالعالم"); // Hebrew text in English context Bdi hebrew = bdi("שלום עולם"); // Mixed direction text Bdi mixed = bdi("Hello ", bdi("مرحبا"), " World"); // User-generated content Bdi userContent = bdi("This is a comment in Arabic: مرحبا") ._class("user-comment"); // Names in different scripts Bdi name = bdi("محمد أحمد"); // Numbers in different scripts Bdi numbers = bdi("١٢٣٤٥"); // Styled bidirectional text Bdi styled = bdi("نص باللغة العربية") ._class("bidi-text") .style("direction: rtl;");

The following convenience methods are provided for constructing instances of this bean:

See Also: