Giter VIP home page Giter VIP logo

Comments (4)

Nasicus avatar Nasicus commented on September 25, 2024 1

@karldanninger @hgezim
thanks. We're using my "workaround" in production since bascially I wrote this post. No issues.

The only thing I'm a little afraid is that the suddenly change this in the future ;)

from draft-convert.

karldanninger avatar karldanninger commented on September 25, 2024 1

@Nasicus Haha! I have that exact same fear - but we've made a note of this issue in our repo. 👍

Thank you for the explanation @hgezim !!!

from draft-convert.

karldanninger avatar karldanninger commented on September 25, 2024

Experienced this recently.

@Nasicus Your workaround works, thank you! Yet, this makes me a little uncomfortable since I'm unsure why this works the way it does.

Is there any way to not encode originalText supplied to entityToHtml? Perhaps that would defeat the purpose of the function since it's goal is to convert an entity to encoded valid HTML... 🤔

from draft-convert.

hgezim avatar hgezim commented on September 25, 2024

@karldanninger

I looked into why this works and let me see if I understand it:

In entityToHTML, even when you return only <a href='...' />,

When that is converted to HTML, the above is only used to generate the tags (line 35

const entityHTML = getEntityHTML(entity, originalText);
).

In line 36 (

const elementHTML = getElementHTML(entityHTML, originalText);
), getElementHTML is called with originalText which actually ends up being used as the child node of a tag:

Xnip2021-05-31_21-28-15

from draft-convert.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.