π Bug Description
Every blog post published by LeetLog AI β whether to Dev.to, Hashnode, or Medium β always uses the same 4 hardcoded tags:
This happens because content.js never extracts the topic tags from the LeetCode problem page (e.g. Array, Dynamic Programming, Binary Search, Two Pointers), so problem.tags is always null, and devto.py falls back to DEFAULT_TAGS every single time.
This kills discoverability β a Dynamic Programming blog tagged only as "tutorial" will never reach the right audience on Dev.to or Hashnode.
π Root Cause (3 files)
1. extension/content.js β topic tags never extracted
The extension extracts title, description, code, difficulty, and author β but nothing reads the LeetCode topic tags from the DOM.
LeetCode renders topic tags as links in a dedicated section:
const tagElements = document.querySelectorAll('a[href*="/tag/"]');
const topics = Array.from(tagElements).map(el => el.innerText.trim().toLowerCase());
2. extension/background.js β tags not in destructured payload
// Line 16 β current code
const { title, description, code, author, client_time, custom_prompt, difficulty } = request.payload;
// tags is never destructured or forwarded to the backend
3. backend/devto.py β hardcoded fallback always wins
DEFAULT_TAGS = ["leetcode", "dsa", "programming", "tutorial"]
# In publish_to_platforms():
clean_tags = [
tag.strip().lower().replace(" ", "-")
for tag in (tags or DEFAULT_TAGS) # tags is always None β always DEFAULT_TAGS
...
]
π Steps to Reproduce
- Open any LeetCode problem (e.g. "Two Sum" β tagged: Array, Hash Table).
- Submit a solution and let LeetLog AI generate and publish a blog.
- Check the published article on Dev.to β tags will be
leetcode, dsa, programming, tutorial instead of array, hash-table.
β
Expected Behavior
Tags extracted from the LeetCode problem page should flow through the full pipeline and be used when publishing. Hardcoded defaults should only apply if the problem has no tags at all.
π‘ Proposed Fix
content.js β extract topic tags:
const tagElements = document.querySelectorAll('a[href*="/tag/"]');
const topics = Array.from(tagElements)
.map(el => el.innerText.trim().toLowerCase())
.filter(Boolean)
.slice(0, 4); // Dev.to allows max 4 tags
Include topics in the GENERATE_BLOG payload.
background.js β destructure and forward topics:
const { title, description, code, author, client_time, custom_prompt, difficulty, topics } = request.payload;
// then include topics in the fetch body as `tags: topics`
main.py β Problem.tags already exists, no model change needed β
π Additional Context
- Affects:
extension/content.js, extension/background.js, backend/devto.py
- The
Problem model in main.py already has a tags: list[str] | None field β the plumbing exists, it's just never filled.
- No new dependencies required.
- Fix also improves SEO and reach of published articles on all 3 supported platforms.
π Bug Description
Every blog post published by LeetLog AI β whether to Dev.to, Hashnode, or Medium β always uses the same 4 hardcoded tags:
This happens because
content.jsnever extracts the topic tags from the LeetCode problem page (e.g.Array,Dynamic Programming,Binary Search,Two Pointers), soproblem.tagsis alwaysnull, anddevto.pyfalls back toDEFAULT_TAGSevery single time.This kills discoverability β a Dynamic Programming blog tagged only as "tutorial" will never reach the right audience on Dev.to or Hashnode.
π Root Cause (3 files)
1.
extension/content.jsβ topic tags never extractedThe extension extracts title, description, code, difficulty, and author β but nothing reads the LeetCode topic tags from the DOM.
LeetCode renders topic tags as links in a dedicated section:
2.
extension/background.jsβtagsnot in destructured payload3.
backend/devto.pyβ hardcoded fallback always winsπ Steps to Reproduce
leetcode, dsa, programming, tutorialinstead ofarray, hash-table.β Expected Behavior
Tags extracted from the LeetCode problem page should flow through the full pipeline and be used when publishing. Hardcoded defaults should only apply if the problem has no tags at all.
π‘ Proposed Fix
content.jsβ extract topic tags:Include
topicsin theGENERATE_BLOGpayload.background.jsβ destructure and forwardtopics:main.pyβProblem.tagsalready exists, no model change needed βπ Additional Context
extension/content.js,extension/background.js,backend/devto.pyProblemmodel inmain.pyalready has atags: list[str] | Nonefield β the plumbing exists, it's just never filled.