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

Importing HTML with escape characters to CMS cause the error Failed to upload images in formatted text for field: content #132

Open
remorses opened this issue Dec 11, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@remorses
Copy link

Describe the bug
Here is an example html document that fails to get imported into Framer CMS as rich text:

<html>
<p>example md file</p>
<pre><code>import { z } from &#39;zod&#39;

</code></pre>

</html>

The scape characters are generated by a markdown renderer, these characters seem to cause the error

To Reproduce
Steps to reproduce the behavior:

  1. Try to import the document above as rich text
  2. You should get an error Failed to upload images in formatted text for field: content
    Expected behavior
    Correctly import html

Screenshots

Additional context

@remorses remorses added the bug Something isn't working label Dec 11, 2024
@remorses remorses changed the title Importing html with escape characters cause the error Failed to upload images in formatted text for field: content Importing HTML with escape characters to CMS cause the error Failed to upload images in formatted text for field: content Dec 11, 2024
@alecmev
Copy link
Contributor

alecmev commented Dec 13, 2024

Thanks for the report! The error is fixed, and we're working on <pre><code> being stripped.

@alecmev alecmev closed this as completed Dec 13, 2024
@remorses
Copy link
Author

By the way an user reported that some code blocks languages were always detected as jsx, it would be cool to list all available languages in the docs and default to no language by default

I assume now the language is detected from the class of the code tag

@alecmev
Copy link
Contributor

alecmev commented Dec 13, 2024

From @remorses in Slack:

If i include the wrapper tag it does not throw the error, if instead

  • I remove the wrapper tag
  • Use the quote characters ' directly instead of &#39;
  • If I leave a tag open (remove for example) I still get the error "Failed to upload images in formatted text for field: Content, in item: 00000078"

I think the problem is that

  • These issues are caused by html parsing errors or traversing
  • Any error in the html step is always thrown as "Failed to upload images..."

After I get the first "Failed to upload images" error I have to reload Framer to get rid of it, probably because of some session state

@alecmev alecmev reopened this Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants