Tighten configuration and export handling
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
from typing import List
|
||||
from .base import Formatter
|
||||
|
||||
from ..types import ReportRow
|
||||
from .base import Formatter
|
||||
|
||||
|
||||
def _escape_markdown_table_cell(value: object) -> str:
|
||||
return str(value).replace("\\", "\\\\").replace("|", "\\|").replace("\n", "<br>")
|
||||
|
||||
|
||||
class MarkdownFormatter(Formatter):
|
||||
@@ -15,10 +20,13 @@ class MarkdownFormatter(Formatter):
|
||||
"|--------|--------|--------|--------|-----------|",
|
||||
]
|
||||
for r in rows:
|
||||
task_cell = f"{r['issue_id']}. {r['subject']}"
|
||||
task_cell = _escape_markdown_table_cell(f"{r['issue_id']}. {r['subject']}")
|
||||
lines.append(
|
||||
f"| {r['display_project']} | {r['display_version']} "
|
||||
f"| {task_cell} | {r['status_ru']} | {r['time_text']} |"
|
||||
f"| {_escape_markdown_table_cell(r['display_project'])} "
|
||||
f"| {_escape_markdown_table_cell(r['display_version'])} "
|
||||
f"| {task_cell} "
|
||||
f"| {_escape_markdown_table_cell(r['status_ru'])} "
|
||||
f"| {_escape_markdown_table_cell(r['time_text'])} |"
|
||||
)
|
||||
return "\n".join(lines)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user