Skip to content

Commit

Permalink
Allow markup-ing literal strings
Browse files Browse the repository at this point in the history
Literal strings in the application should be safe (similar to static markup in template files), and then normal way to create dynamic markup code side: create a properly marked up `Markup`, then `Markup.format` user-defined content into it.
  • Loading branch information
xmo-odoo committed Jun 14, 2024
1 parent 311ca4e commit 1bb544a
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ rules:
- python
severity: WARNING
pattern-either:
- pattern: flask.Markup(...)
- pattern: flask.Markup($Q)
- pattern: flask.Markup.unescape(...)
- pattern: markupsafe.Markup(...)
- pattern: markupsafe.Markup($Q)
- pattern: $MARKUPOBJ.unescape()
- metavariable-pattern:
metavariable: $Q
patterns:
- pattern-not: '"..."'

0 comments on commit 1bb544a

Please sign in to comment.