Skip to content

Line Break

LineBreak class to “text:line-break” tag.

Classes:

Name Description
LineBreak

Representation of a line break, “text:line-break”.

LineBreak

Bases: MDLineBreak, Element

Representation of a line break, “text:line-break”.

Methods:

Name Description
__init__

Initialize the LineBreak element.

__str__

Attributes:

Name Type Description
text str

Get the textual representation of the line break.

Source code in odfdo/line_break.py
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
class LineBreak(MDLineBreak, Element):
    """Representation of a line break, "text:line-break"."""

    _tag = "text:line-break"

    def __init__(self, **kwargs: Any) -> None:
        """Initialize the LineBreak element.

        Args:
            **kwargs: Additional keyword arguments for the parent `Element` class.
        """
        super().__init__(**kwargs)

    def __str__(self) -> str:
        return "\n"

    @property
    def text(self) -> str:
        """Get the textual representation of the line break.

        Returns:
            str: Always returns a newline character ("\\n").
        """
        return "\n"

    @text.setter
    def text(self, text: str | None) -> None:
        pass

_tag class-attribute instance-attribute

_tag = 'text:line-break'

text property writable

text: str

Get the textual representation of the line break.

Returns:

Name Type Description
str str

Always returns a newline character (“\n”).

__init__

__init__(**kwargs: Any) -> None

Initialize the LineBreak element.

Parameters:

Name Type Description Default
**kwargs Any

Additional keyword arguments for the parent Element class.

{}
Source code in odfdo/line_break.py
39
40
41
42
43
44
45
def __init__(self, **kwargs: Any) -> None:
    """Initialize the LineBreak element.

    Args:
        **kwargs: Additional keyword arguments for the parent `Element` class.
    """
    super().__init__(**kwargs)

__str__

__str__() -> str
Source code in odfdo/line_break.py
47
48
def __str__(self) -> str:
    return "\n"