Skip to content

Render announcements, question replies, and messages as markdown#1402

Merged
veluca93 merged 6 commits into
cms-dev:mainfrom
e-i-o:announcements-markdown
Jun 10, 2025
Merged

Render announcements, question replies, and messages as markdown#1402
veluca93 merged 6 commits into
cms-dev:mainfrom
e-i-o:announcements-markdown

Conversation

@prandla

@prandla prandla commented Jun 9, 2025

Copy link
Copy Markdown
Member

Closes #1352, closes #1362.

I actually realized that i had forgotten messages to users in my original implementation; this one handles those too.

I switched out the markdown parser to one that allows disabling html tags.

Comment thread cms/server/jinja2_toolbox.py
Comment thread cms/server/admin/templates/announcements.html Outdated
@prandla

prandla commented Jun 9, 2025

Copy link
Copy Markdown
Member Author

gah, i noticed a bug about question-answering (with the precompiled answer dropdown, the js hardcodes that the "other" option is at index 5, which it isn't anymore), and i also noticed that there's a bunch of JS that's duplicated (including duplicating the bug). Do you mind if i refactor it in this same PR? Because i need to refactor that JS a little anyways to add markdown preview.

@veluca93

veluca93 commented Jun 9, 2025

Copy link
Copy Markdown
Contributor

gah, i noticed a bug about question-answering (with the precompiled answer dropdown, the js hardcodes that the "other" option is at index 5, which it isn't anymore), and i also noticed that there's a bunch of JS that's duplicated (including duplicating the bug). Do you mind if i refactor it in this same PR? Because i need to refactor that JS a little anyways to add markdown preview.

Sure!

prandla added 4 commits June 9, 2025 12:29
* Deduplicate code in questions view / participant view
* Deduplicate set of quick answers

As a result, the question-answering experience in the participant view
is now a bit better.
@prandla
prandla force-pushed the announcements-markdown branch from 79082ff to 89ac3d5 Compare June 10, 2025 12:35
@prandla

prandla commented Jun 10, 2025

Copy link
Copy Markdown
Member Author

Also closes #1362 now.

Comment thread cms/server/admin/handlers/contestquestion.py
Comment thread cms/server/admin/templates/macro/question.html
Comment thread cms/server/admin/templates/macro/question.html
Comment thread cms/server/admin/handlers/contestquestion.py Outdated
@veluca93
veluca93 merged commit 1ccdfc1 into cms-dev:main Jun 10, 2025
1 check passed
@prandla
prandla deleted the announcements-markdown branch June 11, 2025 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Refactor question answers Rendering announcements and question replies as markdown

2 participants