Detect insights subcategory from post categories.
(self, post: dict)
| 123 | return "" |
| 124 | |
| 125 | def detect_subcategory(self, post: dict) -> str: |
| 126 | """Detect insights subcategory from post categories.""" |
| 127 | cat_ids = post.get("categories", []) |
| 128 | for cat_id in cat_ids: |
| 129 | slug = self.get_category_slug(cat_id) |
| 130 | if slug in CATEGORY_MAP: |
| 131 | return CATEGORY_MAP[slug] |
| 132 | return DEFAULT_SUBCATEGORY |
| 133 | |
| 134 | def html_to_markdown(self, html: str) -> str: |
| 135 | if not html: |
no test coverage detected