Rules Hub
Coding Rules Library
← Back to all rules
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
frontend ruleP1stack specificStack: react
reacthtmldangerouslySetInnerHTMLrendering
Render rich HTML content via the proper mechanism, not manual tag stripping
To display server HTML content, use the framework's HTML-rendering API rather than hand-written regex to strip tags.
PR: hegnar-forum-web · org-mining-hist-2026-06Created: Jun 20, 2026
Bad example
Old codetypescript
| 1 | const content = StringUtils.removePTag(rawContent); |
| 2 | <Typography>{content}</Typography> |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | <Typography component="div" dangerouslySetInnerHTML={{ __html: rawContent }} /> |
Explanation (EN)
Objašnjenje (HR)