Git Product home page Git Product logo

Comments (7)

Mokkapps avatar Mokkapps commented on July 17, 2024 5

I just had a similar problem with this code inside the HTML:

</p>\n<blockquote class=\"instagram-media\" data-instgrm-captioned data-instgrm-permalink=\"https://www.instagram.com/p/BcECNjNlCJc/\" data-instgrm-version=\"8\" style=\" background:#FFF; border:0; border-radius:3px; box-shadow:0 0 1px 0 rgba(0,0,0,0.5),0 1px 10px 0 rgba(0,0,0,0.15); margin: 1px; max-width:658px; padding:0; width:99.375%; width:-webkit-calc(100% - 2px); width:calc(100% - 2px);\">\n<div style=\"padding:8px;\">\n<div style=\" background:#F8F8F8; line-height:0; margin-top:40px; padding:50% 0; text-align:center; width:100%;\">\n<div style=\" background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAsCAMAAAApWqozAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAMUExURczMzPf399fX1+bm5mzY9AMAAADiSURBVDjLvZXbEsMgCES5/P8/t9FuRVCRmU73JWlzosgSIIZURCjo/ad+EQJJB4Hv8BFt+IDpQoCx1wjOSBFhh2XssxEIYn3ulI/6MNReE07UIWJEv8UEOWDS88LY97kqyTliJKKtuYBbruAyVh5wOHiXmpi5we58Ek028czwyuQdLKPG1Bkb4NnM+VeAnfHqn1k4+GPT6uGQcvu2h2OVuIf/gWUFyy8OWEpdyZSa3aVCqpVoVvzZZ2VTnn2wU8qzVjDDetO90GSy9mVLqtgYSy231MxrY6I2gGqjrTY0L8fxCxfCBbhWrsYYAAAAAElFTkSuQmCC); display:block; height:44px; margin:0 auto -44px; position:relative; top:-22px; width:44px;\"></div>\n</div>\n<p style=\" margin:8px 0 0 0; padding:0 4px;\"> <a href=\"https://www.instagram.com/p/BcECNjNlCJc/\" style=\" color:#000; font-family:Arial,sans-serif; font-size:14px; font-style:normal; font-weight:normal; line-height:17px; text-decoration:none; word-wrap:break-word;\" target=\"_blank\">#avengersinfinitywar #infinitywar #infinitystones #ironspider #ironman #spiderman #spidermanhomecoming #captainamericacivilwar #vingadores #guerrainfinita #peterparker #tonystark #tomholland #robertdowneyjr #marvelcomics #marvel</a></p>\n<p style=\" color:#c9c8cd; font-family:Arial,sans-serif; font-size:14px; line-height:17px; margin-bottom:0; margin-top:8px; overflow:hidden; padding:8px 0 7px; text-align:center; text-overflow:ellipsis; white-space:nowrap;\">Ein Beitrag geteilt von <a href=\"https://www.instagram.com/superhero_world1996/\" style=\" color:#c9c8cd; font-family:Arial,sans-serif; font-size:14px; font-style:normal; font-weight:normal; line-height:17px;\" target=\"_blank\"> Gabriel Rock</a> (@superhero_world1996) am <time style=\" font-family:Arial,sans-serif; font-size:14px; line-height:17px;\" datetime=\"2017-11-29T02:51:34+00:00\">Nov 28, 2017 um 6:51 PST</time></p>\n</div>\n</blockquote>\n<p><script async defer src=\"//platform.instagram.com/en_US/embeds.js\"></script></p>\n<p>

To make it work I had to additionally add padding to the ignored styles:

ignoredStyles={['display', 'width', 'height', 'font-family', 'padding']}

from react-native-render-html.

Exilz avatar Exilz commented on July 17, 2024 1

I can render your HTML if I ignore the following styles :

  • display, because of block
  • width and height because of calc() not being supported at all
  • font-family because I'm missing those fonts

from react-native-render-html.

Exilz avatar Exilz commented on July 17, 2024

Hi,

It's working fine for me with 3.5.2 🤔

<div style="display:block"><p>crash ?</p></div> crashes as expected, but with ignoredStyles={['display']} it doesn't.

Can I see your full HTML content and props ? I guess you must have another faulty style somewhere.

from react-native-render-html.

Exilz avatar Exilz commented on July 17, 2024

Oh, and by the way, if your display style is in an <a> tag, it has been fixed here #60.

I'm just waiting until I finish some new features and fixes to merge it with the next version of the plugin.

from react-native-render-html.

diamanthaxhimusa avatar diamanthaxhimusa commented on July 17, 2024

@Exilz it is inside a div, it is a instagram embed post. Can it be because of nested divs?

check it: https://pastebin.com/mtqvQ5kS

from react-native-render-html.

diamanthaxhimusa avatar diamanthaxhimusa commented on July 17, 2024

@Exilz cool so the problem was width, height & font-family after display, strange why debugger didn't show any errors, maybe because app crashed before logging errors. Thanks anyway, great work 🙌

from react-native-render-html.

MrLich avatar MrLich commented on July 17, 2024

have anyone tried to replace it with new props for style?

from react-native-render-html.

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.