Repository navigation
Add safe Markdown formatting to Admin News and Changelog - #37
Merged
Merged
Conversation
# Conflicts: # apps/site-web/static/assets/site.css
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Safety
Markdown is parsed with
pulldown-cmarkand cleaned withammonia. Only paragraphs, breaks, emphasis, links, lists, code and blockquotes survive. Raw HTML is escaped, images are stripped, and script/data/vbscript links and event/style attributes cannot execute. The browser never parses Markdown or places textarea input into HTML. News excerpts are plain text.The preview endpoint is Admin-only, rate-limited,
private, no-store, and makes no database or audit writes. Tests cover XSS, forged HTML, permissions, preview/public parity, legacy snapshots, and blank list lines.Migration / rollout
0064_content_markdown.sqladds nullable, checkedcontent_formatcolumns tonews_postsandchangelog_entries. No defaults, data backfills, rewrites, deletes, or changes to characters / hours. NULL keeps the old renderer; new edited content is markedmarkdown.Review only: no pull request merged or deployed, and no live DB writes performed. Deploy the server migration/API and static Admin/public assets together after approval. Existing content needs no resave.
Validation
cargo fmt --all -- --check: passed.cargo clippy -p fraglink-core -p fraglink-sync -p fraglink-server --all-targets -- -D warnings: passed.node --test apps/site-web/tests/*.test.cjs: 31 passed (8 new Markdown UI tests). Added these to Linux CI.f29272c3e3248681028d21a31e1ddb870f484bea: https://github.com/Lucrona/fraglink/actions/runs/42894307584. Linux passed whole-workspace fmt, strict clippy, Rust tests, UI tests and the simulation smoke run; Windows passed strict clippy, core/sync tests and the installer build.Fixture preview
/workspace/pr-markdown-preview/editor.htmlandeditor.png: fixture-only static rendered mock using the real toolbar markup and real server-rendered sanitized output. No live data. This is not a browser screenshot or an end-to-end browser interaction test.Migration collision fix
Updated by a normal merge of wow-played
2978f1b6b1dec918ad8984ef05ac2c7a296a9f07after PR 38 merged. PR 38 keeps0063_wow_forever_rulesets.sql; content Markdown now uses0064_content_markdown.sql. The stylesheet conflict retains PR 38 popup-avatar sizing unchanged and appends only Markdown styles.Published history is preserved: merge commit
2160f6cincorporates wow-played, thenf29272crenumbers the migration.git diff --exit-code 02ea9fcba02d9bf3c874bfb11041a87ac296374f HEADpassed: the final tree exactly matches the tested preparation candidate. Pushed normally, without force.