Skip to content

Rich text handling#162

Merged
rosemcc merged 52 commits into
masterfrom
rich-text-handling
Oct 29, 2021
Merged

Rich text handling#162
rosemcc merged 52 commits into
masterfrom
rich-text-handling

Conversation

@rosemcc
Copy link
Copy Markdown
Contributor

@rosemcc rosemcc commented Oct 26, 2021

  • Redesigned body media service to build 'global' link maps for resolving data in rich text nodes with linked entries/assets, instead of using the service to manage one rich text field at a time. The solution uses the ngx-contentful-rich-text library as before, but handles the linked data in a better way.
  • This addresses the existing problem with handling page types that have multiple rich text fields.
  • Removed the no longer needed sub-components of funding and case study pages.
  • The BodyMediaComponent which previously handled all the rich text nodes types has been split out into separate components to make it more manageable:
    • BlocksEmbeddedAssetComponent
    • BlocksEmbeddedEntryComponent
    • BlocksQuoteComponent
    • InlinesAssetHyperlinkComponent
    • InlinesEmbeddedEntryComponent
    • InlinesEntryHyperlinkComponent
    • MarksCodeComponent
  • The rich text pipe is gone now in favour of only using ngx-contentful-rich-text
  • Updated and consistent GraphQL queries for rich text fields.
  • Fixed issues with rich text types e.g. inline asset and entry hyperlinks working, handling of internal links.
  • Numbered lists are fixed in Firefox
  • SVG images can now be used in rich text
  • Styling and accessibility improvement for Cards within rich text and fixed issue of images not showing for certain content types
  • Replaced markdown-to-html-pipe (no longer maintained) with ngx-markdown
  • Empty inline code issue is now handled with custom renderer (MarksCodeComponent)

Ref: https://www.contentful.com/blog/2021/04/14/rendering-linked-assets-entries-in-contentful/

@rosemcc rosemcc requested a review from Trombach October 26, 2021 23:12
Copy link
Copy Markdown
Contributor

@Trombach Trombach left a comment

Choose a reason for hiding this comment

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

Nice work, Rose. This is so much better than before! I've added one minor suggestion that you can decide if you want to change it.

Comment thread research-hub-web/angular.json
Comment thread research-hub-web/package.json
…entry-hyperlink/inlines-entry-hyperlink.component.html

Co-authored-by: Lukas Trombach <19306765+Trombach@users.noreply.github.com>
@rosemcc rosemcc merged commit fc2f168 into master Oct 29, 2021
@rosemcc rosemcc deleted the rich-text-handling branch October 29, 2021 04:03
@rosemcc rosemcc mentioned this pull request Nov 24, 2021
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.

2 participants