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

HYC-1999 - Disable copy-pasted text styling in rich text fields #1145

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion app/renderers/hyrax/renderers/formatted_text_renderer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ def get_sanitized_string(string)
# Same as attribute renderer override, but without escaping the value
def li_value(value)
field_value = find_language(value) || value
auto_link((field_value))
# Use get_sanitized_string instead of auto_link sanitization to preserve HTML tags (specifically underline)
get_sanitized_string(field_value)
auto_link(field_value, sanitize: false)
end
end
end
Expand Down
3 changes: 2 additions & 1 deletion config/tinymce.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ rich_text:
toolbar:
- "undo redo | bold italic underline | alignleft aligncenter alignright | link | numlist bullist outdent indent | blockquote | code"
plugins:
- "link lists code"
- "link lists code paste"
invalid_styles: "color font-family"
style_formats:
- title: "Inline"
items:
Expand Down
3 changes: 1 addition & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ services:
- hycdev
solr:
image: solr:9
user: "8983:8983"
user: root
volumes:
- ./solr/config:/opt/solr/server/solr/configsets/hy-c/conf
- solr-data:/var/solr/data
Expand All @@ -111,7 +111,6 @@ services:
"
environment:
- SOLR_MODULES=analysis-extras,extraction
user: root
networks:
- hycdev
volumes:
Expand Down
Loading