Skip to content

Add WordCensor SE5 plugin#273

Merged
niksedk merged 1 commit into
mainfrom
word-censor
May 17, 2026
Merged

Add WordCensor SE5 plugin#273
niksedk merged 1 commit into
mainfrom
word-censor

Conversation

@niksedk
Copy link
Copy Markdown
Member

@niksedk niksedk commented May 17, 2026

Summary

Port of the SE4 WordCensor plugin, the third SE5 plugin built on top of `Plugin-Shared` (after AmericanToBritish + BritishToAmerican).

Engine

`WordCensorEngine` replaces the first ~50% of each offensive word with random grawlix characters (`@ # ! ? $ % &`). Optionally wraps the censored word in `…`. Single-word entries from the bundled list are matched case-insensitively as whole words; multi-word phrases (`blow job`, `god damn`) are matched verbatim before the single-word pass.

`BadWords.txt` is the same list the SE4 version shipped (76 entries) — embedded as a resource of the plugin assembly.

UI

Same preview pattern as AmericanToBritish:

  • Title + scope summary ("Replace offensive words with grawlix characters (#@!$%) in the X selected line(s)…").
  • A list of every affected line — original (muted) above, censored (SemiBold) below, with a checkbox to include/exclude that line and the SRT line number.
  • A Highlight censored words in red toggle in the toolbar — the preview re-runs live when the user flips it, so they can see both styles before applying. Preference is persisted via the plugin Settings round-trip.
  • Select all / Select none, a "X of Y line(s) selected" summary, Cancel, and an accent-styled Apply (disabled when nothing is checked).
  • Empty list ⇒ a centered "No offensive words found in the selected lines." instead of an empty box.
  • Theme variant comes from `request.theme` (via Plugin-Shared's `PluginApp`).

Build + index

  • `.github/workflows/word-censor.yml` mirrors the other SE5 plugin workflows: matrix self-contained publish for the six supported RIDs, plugin.json rewritten per-platform with the `executables` block, six zips uploaded as artifacts, and a GitHub release on manual dispatch with a tag.
  • `se5-plugins.json` extended with a Word censor entry pointing at the planned `se5-word-censor-v1.0` release assets via the per-platform `downloads` map.

Test plan

  • CI matrix build passes on all six RIDs.
  • After merge, dispatch the workflow with tag `se5-word-censor-v1.0` to publish the release.
  • In SE: install via Get plugins online... → run on a subtitle containing some of the bundled bad words → preview lists the affected lines → flip "Highlight in red" to see the <font> wrapping → Apply replaces only the checked ones → status shows count.
  • Reopen the plugin — "Highlight in red" remembers its last value.

🤖 Generated with Claude Code

Port of the SE4 WordCensor: replaces the first ~50% of each
offensive word with random grawlix characters (#@!?$%&). Optionally
wraps the censored word in <font color="#ff0000">...</font>.

Built on Plugin-Shared, so theme passing, SRT parsing, and the
plugin boot all come for free. The bundled BadWords.txt is the same
list as the SE4 version. Single-character entries and very short
words are left alone; multi-word phrases (e.g. "blow job") are
matched verbatim before the single-word pass.

UI mirrors the AmericanToBritish preview pattern: per-line checkbox
list with the original (muted) and censored (SemiBold) versions, a
"Highlight in red" toggle that re-runs the preview live, Select all
/ Select none, accent Apply, and "No offensive words found" as the
empty state. The colour-red preference is persisted via the plugin
Settings round-trip.

Workflow .github/workflows/word-censor.yml mirrors the other SE5
plugin workflows; se5-plugins.json gets a Word censor entry pointing
at the planned se5-word-censor-v1.0 release.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@niksedk niksedk merged commit 5b5b3f1 into main May 17, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant