1. PROMO Upgrade to Pro Membership @ $99 / Lifetime & access all our 16+ premium Divi extensions: Divi Block, Carousel Toolkit, etc.LEARN MORE
Dismiss Notice
NEW Divi.Help Pro Carousel AI Toolkit - Magically turn your Divi design into carousel, simply by using our online toolkit. No plugins needed. Now it works with Divi 5 as well!Try our carousel AI toolkit
BEST Divi Block - A revolutionary drag & drop tool to easily mix & match 960+ premade blocks (Light & Dark) to kick start your Divi site design. Special module designs are included as well. Also newly added AI generator & color. Now it works with Divi 5 as well!
Learn More About Divi BlockFree Version ~ 340+ Free Blocks

Divi Code Module Javascript Character values

Discussion in 'Free Divi Community Forum' started by Sam Morgan, Jun 13, 2019.

  1. Sam Morgan

    Sam Morgan New Member

    Hi there,
    I'm writing an English exercise for my students that uses html and javascript. In the code module I have an answer variable in <script>:

    answers77[1] = "don't all agree that the term superfood is used to sell food products.";

    However when I inspect the published page this is formatted to:


    answers77[1] = "don&rsquo;t all agree that the term superfood is used to sell food products.";


    This is not the case when outside <script>, ie in an html <form>. "don't all agree that the term superfood is used to sell food products."; remains exactly the same after the post is published.

    So when the form value (with the don't ) is compared against the javascript answer (&rsquo;t) the exercise mistakenly states that the answer is incorrect.

    Is there anyway of stopping this automatic formatting from happening (so that I don't need to manually go back alter all my previous exercises)? My previous non-wordpress website did not do this and so the exercises all worked well.

    Cheers,
    Sam
     
    1. PRO MEMBER PERKS Divi Ultimate Footer Plugin - Custom global Divi footer (20 premade styles) + Revealing footer effect:Learn More
  2. Divi.Help

    Divi.Help Administrator
    Staff Member

    Perhaps insert this symbol before the apostrophe sign: