PricingBlog
  • founderlevin-1487401060174921809

    Founderlevin

    9 hours ago

    Hello, I'm trying to insert code from a database like this:

    Your next <span class="highlight">headshot</span> against an enemy Hero deals <svg width="128" height="128" viewBox="0 0 128 128" fill="white" xmlns="http://www.w3.org/2000/svg">
    <path d="M32.0027 9C40.8042 9 48.6533 13.3022 53.7875 20.0238H53.7766C57.1324 24.4142 58.5664 26.6091 59.9993 26.6084C61.4318 26.6078 62.8632 24.4129 66.2125 20.0238C71.3467 13.3022 79.1958 9 87.9973 9C103.466 9 116 22.2789 116 38.6558C116 38.7707 115.999 38.8854 115.998 39H4.00155C4.00052 38.8854 4 38.7707 4 38.6558C4 22.2789 16.5345 9 32.0027 9Z" fill="white"/>
    <path d="M24.5608 79C27.3761 82.0873 30.3317 85.1748 33.3264 88.303C41.7966 97.1509 50.5788 106.325 57.3782 116.742C58.8889 119.051 61.1111 119.051 62.6218 116.742C69.4174 106.328 78.1987 97.1556 86.6692 88.3073C89.6652 85.1778 92.6222 82.0889 95.4388 79H24.5608Z" fill="white"/>
    <path d="M123 59.0055C123 59.0055 117.403 49 100.88 49H75V69H100.88C117.413 69 123 58.9945 123 58.9945V59.0055Z" fill="white"/>
    <path d="M67 57C68.1046 57 69 57.8954 69 59C69 60.1046 68.1046 61 67 61H7C5.89543 61 5 60.1046 5 59C5 57.8954 5.89543 57 7 57H67Z" fill="white"/>
    </svg>
    <span class="inline-attribute-label BonusWeaponDamage">bonus weapon damage</span>.

    I don't want to parse it and make my code heavier, but I can't find a way to implement it. I tried pasting it into both a div and a p. The AI ​suggested unrealistic options. And all 10 tokens on a blank page yielded no results. It still couldn't output formatted text.
  • whitep4nth3r-1487460874938618008

    salma

    5 hours ago

    Unfortunately there isn’t a way to render HTML from a database in nordcraft.

    My advice would be this

    1. If possible, don’t store the content you want as HTML in the database and store it as single text strings or JSON instead , I know this might not be convenient

    so option 2

    2. Intercept the HTML using another (coded) app that converts the HTML to JSON to render it more easily in nordcraft


    I know you may not have control over the DB, but delivering HTML (especially when created by another content management interface) is pretty old school and does have some security implications

    If someone added a script tag with malicious HTML into the database, you could end up rendering that in your front end, opening it up for attack

    Furthermore it’s always better to keep styling and HTML semantics control in your front end rather than relying on the HTML tags and CSS classes etc returned from the database, as you have more control over how the code is rendered and presented in the front end

    Sorry that wasn’t the answer you were most likely looking for