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

Use partials for search results #2387

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
Draft

Use partials for search results #2387

wants to merge 11 commits into from

Conversation

teceler
Copy link
Contributor

@teceler teceler commented Jan 5, 2025

Todo: Handle differing reply links in some way that isn't more horrifying branching code (content_for?)

.post-content= sanitize_written_content(reply.content.to_s, reply.editor_mode)
.post-content
- if params[:subj_content].present?
= reply.pg_search_highlight.html_safe
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[brakeman] reported by reviewdog 🐶
Cross-Site Scripting Template Unescaped model attribute near line 63: (Unresolved Model).new.pg_search_highlight High

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean you're not wrong that probably should be wrapped in sanitize_written_content or a version thereof, but also if that's a problem it already was

%td.padding-5{class: klass, style: 'width:15%'}= nickname
%td.padding-5{class: klass, style: 'width:15%'}= breakable_text(screenname)
%td.padding-5{class: klass, style: 'width:20%'}= pb
- pb_width = show_cluster ? 'width:20%' : 'width:25%'
%td.padding-5{class: klass, style: pb_width}= pb
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [haml-lint] reported by reviewdog 🐶
InlineStyles: Do not use inline style attributes

%b= link_to reply.post.subject, reply_path(reply, anchor: "reply-#{reply.id}"), title: strip_tags(reply.post.description)&.html_safe
.post-content
- if params[:subj_content].present?
= reply.pg_search_highlight.html_safe
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[brakeman] reported by reviewdog 🐶
Cross-Site Scripting Template Unescaped model attribute near line 40: (Unresolved Model).new.pg_search_highlight High

- if reply.is_a?(Reply) && reply.id.present?
%a.noheight{id: "reply-#{reply.id}"}= " "
- if reply == @unread
.unread-marker-container
%a#unread.unread-marker First unread marker
.padding-10
%div{class: search_ui ? '' : 'padding-10', style: search_ui ? 'display: inline' : ''}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [haml-lint] reported by reviewdog 🐶
InlineStyles: Do not use inline style attributes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I know i hate it too

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