Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draftail-renderer renders div's inside p tags #49

Open
presto2116 opened this issue Mar 2, 2020 · 2 comments
Open

Draftail-renderer renders div's inside p tags #49

presto2116 opened this issue Mar 2, 2020 · 2 comments
Labels
Type: Bug Something isn't working

Comments

@presto2116
Copy link
Contributor

Description

When working on 2u in dev mode, I get this error every time I pull up a latest-content article. react yells at me for having a nested div inside a p tag.
Warning: validateDOMNesting(...): <div> cannot appear as a descendant of <p>. in div (created by DraftEditorBlock)

Steps to Reproduce

On 2u at least, if you open up the site in dev mode, and go to any of the latest-details pages. i.e.
http://localhost:5000/latest/day-life-2u-senior-manager-internal-communications-candice-adderly/
(production link: https://2u.com/latest/day-life-2u-senior-manager-internal-communications-candice-adderly/)
you will receive this error

Expected Result

Not have a nested div or p tags inside of a p tag.

Actual Result

Screen Shot 2020-03-02 at 1 27 57 PM
Screen Shot 2020-03-02 at 1 28 06 PM

Additional Context

Here is the rendered html of an example above but it seems to affect all of the latest templates on 2u

<p
  class=""
  data-block="true"
  data-editor="cleqc"
  data-offset-key="yxdxs-0-0"
>
  <div
    data-offset-key="yxdxs-0-0"
    class="public-DraftStyleDefault-block public-DraftStyleDefault-ltr"
  >
    <span data-offset-key="yxdxs-0-0">
      <span data-text="true">
        Growing up in Durham, North Carolina,{' '}
      </span>
    </span>
    <a
      href="https://www.linkedin.com/in/candiceadderly/"
      class="sc-chPdSV iFWHec"
      target="_blank"
      aria-label="external link. Candice Adderly"
    >
      Candice Adderly
    </a>
    <span data-offset-key="yxdxs-2-0">
      <span data-text="true">
        ’s life revolved around the “Bull City.” Durham and its people
        instilled in her a sense of confidence and pride, and these
        values motivated her to stay in-state for school and, later, for
        her first job at Hilton Charlotte Center City.
      </span>
    </span>
  </div>
</p>
@presto2116 presto2116 added the Type: Bug Something isn't working label Mar 2, 2020
@elainen
Copy link
Contributor

elainen commented Mar 2, 2020

@presto2116 can you paste here the full json block map that renders the above html?

@elainen elainen removed their assignment Jan 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants