Skip to content

Markdown formatting issue due to escaped newline handling in CLI output #4

@Programming-Sai

Description

@Programming-Sai

Description

The devlog CLI currently stores multiline fields using escaped newline sequences (\n). During markdown generation, these are not consistently converted into actual line breaks, resulting in rendered output containing literal \n instead of proper formatting.

This breaks readability of generated problem logs, especially in solution_desc and solution_snippet fields.

Steps to reproduce

Create a devlog entry with multiline -sd or -ss fields using \n
Run devlog -c to generate markdown output
Observe that \n appears as raw text instead of line breaks

Expected behavior

\n should be interpreted as an actual newline in markdown output
Code snippets and descriptions should render with proper structure

Actual behavior

Literal \n appears in generated markdown
Readability of logs is degraded
Solution sections appear as single-line escaped strings

Suggested fix

Add preprocessing step in markdown generation:
Replace \n with \n before writing output
Ensure consistent decoding across:
solution_desc
solution_snippet
any multiline CLI input fields

Impact

Affects readability of all generated problem logs
Makes structured study logs harder to reuse or review

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions