docs: add block/mute user relations, emoji-sync CLI, and uid indexes
DevPlace CI / test (push) Failing after 2m7s
DevPlace CI / test (push) Failing after 2m7s
- Add `/block`, `/mute` endpoints with block/unblock and mute/unmute functionality in `routers/relations.py`, hiding blocked users' content everywhere except their own profile while muting only suppresses notifications - Introduce `devplace emoji-sync` CLI command to regenerate `static/js/emoji-shortcodes.js` from the emoji library, documented in `CLAUDE.md` and wired in `cli.py` - Create `get_blocked_uids()` database helper and apply it in `content.py` `load_detail()` to filter blocked users' posts from detail views - Implement `_uid_index()` and `_drop_index()` helpers in `database.py` for unique uid indexes across tables, with `user_relations` added to `SOFT_DELETE_TABLES` - Document new routes in `AGENTS.md` and `README.md`, including emoji shortcodes rendering behavior distinct from the emoji picker
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
import html
|
||||
import re
|
||||
from functools import lru_cache
|
||||
|
||||
import mistune
|
||||
|
||||
@@ -16,9 +17,14 @@ _RENDER_BLOCK = re.compile(
|
||||
)
|
||||
|
||||
|
||||
@lru_cache(maxsize=512)
|
||||
def _render_markdown(source: str) -> str:
|
||||
return _markdown(source)
|
||||
|
||||
|
||||
def _convert(match: re.Match) -> str:
|
||||
source = html.unescape(match.group(1)).strip()
|
||||
return f'<div class="docs-content">{_markdown(source)}</div>'
|
||||
return f'<div class="docs-content">{_render_markdown(source)}</div>'
|
||||
|
||||
|
||||
def render_prose(slug: str, context: dict) -> str:
|
||||
|
||||
Reference in New Issue
Block a user