question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Helpers `asHTML` duplicate words in richtext with styling (em, strong, ...)

See original GitHub issue

I’m trying to add bold on word with italic on some letter of this word.

On API, start and end chars are in good position for each styling, but helpers asHTML duplicate the part of word inside <em>

Editor : Capture d’écran 2021-11-26 à 14 10 45

Render : Capture d’écran 2021-11-26 à 14 11 40

I’m using helpers via Eleventy Shortcodes with eleventy-plugin-prismic like this :

{% prismic_asHTML  block_title %}

Version

@prismicio/client: "^5.1.0"
node: "v16.11.1"

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
lihbrcommented, Nov 26, 2021

Hey there, thank you so much for the report!

This looks like a bug with the underlying @prismicio/richtext package we rewrote recently for optimization purposes.

@angeloashmore can you try having a look? (If not I’ll investigate on Monday)

In the meantime if you’re just using the flat asHTML shortcode with no serializer, I’m afraid you can’t do much about it 😕

Definitely critical so we’ll fix that shortly!

1reaction
lihbrcommented, Nov 30, 2021

OK, performed some tests on 11ty and wasn’t able to reproduce both of the above this time 🤔

image

I released an update to the 11ty plugin maintaining dependencies just in case.

If that fixed it for you, I’m still really interested in the result of your npm ls @prismicio/richtext result and your rich text field full content ☺️

Read more comments on GitHub >

github_iconTop Results From Across the Web

Javascript - Copy string to clipboard as text/html
This function expects an HTML string and copies it as rich text. function copyFormatted (html) { // Create container for the HTML //...
Read more >
richtext editor - display only 100 symbols from rich text
This problem is best addressed with CSS, where you are trying to control the size of a rendered string, because 100 characters measures...
Read more >
Fundamental text and font styling - Learn web development
We hope you enjoyed playing with text in this article! The next article will provide you with all you need to know about...
Read more >
How To Select HTML Elements to Style with CSS
This tutorial will build your skill set and help you develop visually rich websites by showing you how to select the right element...
Read more >
Rich Text Editor - Salesforce Help
Rich text editors provide a WYSIWYG interface only; you can't edit HTML tags. When you copy content from a web page or another...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found