Skip to content

fix: remove duplicate code in markdown.py and document both markdown files in README#377

Merged
Durgeshwar-AI merged 2 commits into
Durgeshwar-AI:mainfrom
Nakshathra-2808:fix/remove-duplicate-code-markdown-blueprint
Jun 23, 2026
Merged

fix: remove duplicate code in markdown.py and document both markdown files in README#377
Durgeshwar-AI merged 2 commits into
Durgeshwar-AI:mainfrom
Nakshathra-2808:fix/remove-duplicate-code-markdown-blueprint

Conversation

@Nakshathra-2808

Copy link
Copy Markdown
Contributor

Fixes #375

Changes made

  • Removed duplicate THEMES dict and convert_md_to_html() function from markdown.py — these were imported from md2html.py at the top but immediately redefined locally, making the import pointless
  • markdown.py now correctly uses THEMES, convert_md_to_html, and markdown2 directly from md2html.py as intended
  • Removed unused import (traceback) and dead variable (doc = None)
  • Updated README Folder Descriptions to document both files separately:
    • md2html.py — standalone CLI tool and shared library
    • markdown.py — Flask blueprint that delegates to md2html.py

Testing

  • Verified markdown.py imports correctly from md2html.py with no redefinition
  • No changes to endpoint behavior — /convertMdToHtml works exactly as before

@vercel

vercel Bot commented Jun 18, 2026

Copy link
Copy Markdown

@Nakshathra-2808 is attempting to deploy a commit to the Durgeshwar's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Durgeshwar-AI

Copy link
Copy Markdown
Owner

@Nakshathra-2808 Did you check whether the tool is still working or not?

@Nakshathra-2808

Copy link
Copy Markdown
Contributor Author

Hi @Durgeshwar-AI — yes, I tested it end-to-end now. Backend started cleanly and I confirmed /convertMdToHtml works correctly via curl (heading and bold text rendered properly with the embedded theme CSS). I also ran the frontend (npm run dev), uploaded a test .md file through the UI, and the converted .html downloaded and rendered correctly in the browser.

Side note: while getting the server to start, I hit two unrelated pre-existing bugs blocking python main.py entirely — opened a separate PR for those here: #[new PR number]

@Durgeshwar-AI Durgeshwar-AI merged commit 33dcbe8 into Durgeshwar-AI:main Jun 23, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Redundant/undocumented markdown.py blueprint alongside md2html.py — possible dead code

2 participants