Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eliminate use of v-html when rendering node names and descriptions #908

Merged
merged 6 commits into from
Nov 21, 2024

Conversation

ptgolden
Copy link
Member

@ptgolden ptgolden commented Nov 20, 2024

Related issues

Summary

  • Adds a new component, <AppNodeText> which safely renders text containing <i>, <sup>, and <a> tags, while also leaving arbitrary text <enclosed in brackets> untouched.
  • Removes the usage of the unsafe v-html directive when rendering nodes, replacing it with <AppNodeText>

Checks

  • All tests have passed (or issues created for failing tests)

Patrick Golden added 4 commits November 18, 2024 14:58
Instead of building up a DOM tree from scratch, instead find the strings
matching opening and closing tags, and then surround the contents inside
them. This allows nesting tags within one another. (There were several
cases where <sup> tags had nested <i> tags).

Additionally, following the Vue style guide, use hyphen-case for
template attributes.
Additionally, update documentation.
Copy link

netlify bot commented Nov 20, 2024

Deploy Preview for monarch-app ready!

Name Link
🔨 Latest commit 161a149
🔍 Latest deploy log https://app.netlify.com/sites/monarch-app/deploys/673f4246277cfb0008a5e227
😎 Deploy Preview https://deploy-preview-908--monarch-app.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Nov 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.14%. Comparing base (ce0851b) to head (161a149).
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #908      +/-   ##
==========================================
- Coverage   71.37%   71.14%   -0.24%     
==========================================
  Files          91       91              
  Lines        3148     3136      -12     
==========================================
- Hits         2247     2231      -16     
- Misses        901      905       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@ptgolden ptgolden merged commit af5ab7b into main Nov 21, 2024
11 checks passed
@ptgolden ptgolden deleted the issue-902-appnodebadge-unsafe-html branch November 21, 2024 17:00
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.

HTML injection in phenogrid tooltips (and <AppNodeBadge> more generally)
2 participants