mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-05-15 14:38:03 +02:00
117406f2ce
The form's live README/PR preview was running its own copy of ContentAnonimizer in the browser. The two implementations had been drifting — recent fixes for word boundaries (#175/#249), accent matching (#280), custom replacements (#285), and the diacritic-stripped variants only landed on the server. Reviewers saw one anonymization; authors composing the form saw another. Add POST /api/anonymize-preview that takes a snippet (or a batch) plus the user's options and runs them through the same ContentAnonimizer the file route uses. Replace the client-side anonymizeReadme() body with a debounced call to that endpoint. The PR view's anonymizePrContent() runs as a synchronous template expression, so it now reads from a {original -> anonymized} cache that's refreshed in the background whenever the PR details, terms, or options change. Single-flight + debounce keep the form responsive; an in-flight request is dropped on the next change.
26 lines
639 B
TypeScript
26 lines
639 B
TypeScript
import pullRequestPrivate from "./pullRequest-private";
|
|
import pullRequestPublic from "./pullRequest-public";
|
|
import repositoryPrivate from "./repository-private";
|
|
import repositoryPublic from "./repository-public";
|
|
import conference from "./conference";
|
|
import file from "./file";
|
|
import webview from "./webview";
|
|
import user from "./user";
|
|
import option from "./option";
|
|
import admin from "./admin";
|
|
import anonymizePreview from "./anonymize-preview";
|
|
|
|
export default {
|
|
pullRequestPrivate,
|
|
pullRequestPublic,
|
|
repositoryPrivate,
|
|
repositoryPublic,
|
|
file,
|
|
webview,
|
|
user,
|
|
option,
|
|
conference,
|
|
admin,
|
|
anonymizePreview,
|
|
};
|