Create spreadable presets

Open
#4 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
javascript, react
Domain
frontend, security

Research direction

Start at the ReactSafeHtml component API and inspect how HTML components are currently configured. Compare the requested containers, styleModifiers, tables, links, and images groups with existing behavior; done means callers can spread presets and disable or select individual entries as shown.

Written by the indexing model from the issue text.

Description

It would look like this:

<ReactSafeHtml
  html={html}
  compoennts={{
    // div, span
    ...ReactSafeHtml.presets.containers,
    // or div, span with style attribute
    ...ReactSafeHtml.presets.containersWithStyle,

    // b, strong, i, em, u, ins, strike
    ...ReactSafeHtml.presets.styleModifiers,
    // disable one of them
    strike: undefined.

    ...ReactSafeHtml.presets.tables,
    ...ReactSafeHtml.presets.links,
    // img, figure, etc.
    ...ReactSafeHtml.presets.images,
    // or just pull in img
    img: presets.images.img,
  }}
/>
Dominant language
JavaScript
Stars
26
Forks
2
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from brigand/react-safe-html

All issues in brigand/react-safe-html

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.