| Total Complexity | 1 |
| Total Lines | 26 |
| Duplicated Lines | 0 % |
| Coverage | 87.5% |
| Changes | 0 | ||
| 1 | 1 | from typing import Any |
|
| 2 | |||
| 3 | 1 | from sdoc.sdoc2.formatter.html.HtmlFormatter import HtmlFormatter |
|
| 4 | 1 | from sdoc.sdoc2.node.LineBreakNode import LineBreakNode |
|
| 5 | 1 | from sdoc.sdoc2.NodeStore import NodeStore |
|
| 6 | |||
| 7 | |||
| 8 | 1 | class LineBreakHtmlFormatter(HtmlFormatter): |
|
| 9 | """ |
||
| 10 | HtmlFormatter for generating HTML code for a linebreak. |
||
| 11 | """ |
||
| 12 | |||
| 13 | # ------------------------------------------------------------------------------------------------------------------ |
||
| 14 | 1 | def generate(self, node: LineBreakNode, file: Any) -> None: |
|
| 15 | """ |
||
| 16 | Generates the HTML code for a smile node. |
||
| 17 | |||
| 18 | :param LineBreakNode node: The linebreak node. |
||
| 19 | :param any file: The output file. |
||
| 20 | """ |
||
| 21 | file.write('<br/>') |
||
| 22 | |||
| 23 | |||
| 24 | # ---------------------------------------------------------------------------------------------------------------------- |
||
| 25 | NodeStore.register_formatter('br', 'html', LineBreakHtmlFormatter) |
||
| 26 |