-
Notifications
You must be signed in to change notification settings - Fork 10
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
Support HTML code in community/collection description fields #1322
Comments
Related to #1295 |
@mbarnett not sure what our resources are for these kinds of enhancements at the moment, but I'd like to flag this as a very desirable improvement for ERA. Rather than HTML tags for formatting, I think something like Markdown would work really well since that's already used in many of the tools staff working in repositories are familiar with |
Makes sense! HTML is always a bit of a security risk but Markdown ought to be both more doable and fairly low effort. I’ll refine this out a bit in the next day or two and then flag it as a good issue for some to pick up when they’re between larger priorities. |
Excellent, thanks, Matt! |
Scope/Notes: – We convert Markdown->HTML on page render (so don't store the HTML or anything) |
## Context Many "description" or "abstract" fields (at the Item level as well as Communities and Collections) contain HTML tags. Because these are text fields, HTML is not rendered in the UI and text looks garbled and it's way less readable than ideal. Markdown should work really well for this since that's already used in many of the tools staff working in repositories are familiar with. Related to #1322 Replaces #2230 ## What's New - Added the redcarpet gem because it basically does what we want with markdown. - add `markdown` and `strip_markdown` to ApplicationDecorator - updated SolrExporters to use the new `strip_markdown` helper to remove content being indexed ## Nits * Faker markdown tables aren't parsed as tables by redcarpet. Seems that adding a newline before the table is all that's needed as a workaround though. This means that some text generated by `Faker::Markdown.sandwhich` isn't nice until it's edited to add the extra newline.
Just confirming that this is in production? Feature flag has been enabled but I don't seem to be able to get any formatting to render, e.g. the hyperlink at the bottom of this description: https://era.library.ualberta.ca/admin/communities/e4fdd15f-c21d-4612-a2f7-bfec3fdfc1de/collections/089d2213-9263-4b07-b3c4-05e18d6260dd |
This is in production. There isn't a feature flag for this feature. I'll take a look. |
Thanks Tricia!
…On Thu, 16 Dec 2021 at 11:25, Tricia Jenkins ***@***.***> wrote:
This is in production. There isn't a feature flag for this feature. I'll
take a look.
—
Reply to this email directly, view it on GitHub
<#1322 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADRQ3TUL45EA3NC5EBHGIUTURIVLFANCNFSM4I5HEQFQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
Oh, I see. I missed a spot for rendering the markdown. Need to fix for admin but renders the markdown. |
Thanks! |
I opened a new issue for the outstanding work: #2708 |
Many "Description or abstract" fields (at the Item level), as well as Description fields (Communities and Collections) contain HTML tags. Because these are text fields, HTML is not rendered in the UI and text looks garbled and it's way less readable than ideal.
Support HTML markup, specifically bold/strong text highlighting, italics, line breaks, and paragraphs entered in:
Examples of items with HTML tags:
Ad $ Summary
https://era.library.ualberta.ca/admin/communities/b41cdbfd-6af2-4a13-8ba6-59725565d445/collections/2c1f3d8f-376a-45f8-a422-2afc3363987d
Board Practices
https://era.library.ualberta.ca/admin/communities/b41cdbfd-6af2-4a13-8ba6-59725565d445/collections/71f4b544-22f3-436f-bed0-c215df838be9
Electrical and Computer Engineering, Department of
https://era.library.ualberta.ca/admin/communities/55bafdf5-db7f-48a8-a91e-69b8c01cc9fb
Platts Historical US Domestic Crude Prices
https://era.library.ualberta.ca/admin/communities/b41cdbfd-6af2-4a13-8ba6-59725565d445/collections/b73484ff-194c-4aa5-9011-95410f02ee34
The text was updated successfully, but these errors were encountered: