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

fix: apostrophe-issue-richtext #1314

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

alvarosabu
Copy link
Contributor

  • Introduced a new utility function decodeHtmlEntities to decode HTML entities in strings.
  • Updated convertAttributesInElement to handle string children by decoding HTML entities before processing.
  • Enhanced the handling of text nodes to ensure proper rendering of HTML content in React elements.

- Introduced a new utility function `decodeHtmlEntities` to decode HTML entities in strings.
- Updated `convertAttributesInElement` to handle string children by decoding HTML entities before processing.
- Enhanced the handling of text nodes to ensure proper rendering of HTML content in React elements.
@alvarosabu alvarosabu self-assigned this Jan 10, 2025
@alvarosabu alvarosabu requested a review from edodusi January 10, 2025 15:31
@alvarosabu alvarosabu added bugfix [PR] Fixes a bug p4-important [Priority] Violate documented behavior or significantly improve performance (priority) labels Jan 10, 2025
Copy link

pkg-pr-new bot commented Jan 10, 2025

Open in Stackblitz

npm i https://pkg.pr.new/@storyblok/react@1314

commit: b58cf72

import React from 'react';
import { BrowserRouter, Link, Route, Routes } from 'react-router';
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure we want to make our React playground dependent on react-router honestly, is this needed?

@@ -11,7 +11,7 @@ import { apiPlugin, storyblokInit } from '@storyblok/react';
import IFrameEmbed from './components/iframe-embed';

storyblokInit({
accessToken: 'd6IKUtAUDiKyAhpJtrLFcwtt',
accessToken: 'OurklwV5XsDJTIE1NJaD2wtt',
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we need to document which space is associated with these demo token, or it would be a mess to test them later

@@ -1,5 +1,11 @@
import React from 'react';

function decodeHtmlEntities(text: string): string {
const textarea = document.createElement('textarea');
Copy link
Contributor

Choose a reason for hiding this comment

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

this would break in SSR because of the use of document on the server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix [PR] Fixes a bug p4-important [Priority] Violate documented behavior or significantly improve performance (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants