Skip to content

HTML parser: content gets placed outside the html tag #320

Description

@akshaykmr080

The content inside a HTML tag gets placed outside the HTML in the final output

<a href=\"https://en.wikipedia.org/wiki/HTM\">HTML</a>
The above HTML gets rendered as

<a href=\"https://en.wikipedia.org/wiki/HTM\"></a>HTML

MY code -


const allowedMarkdownTypes = [
  'paragraph',
  'text',
  'emphasis',
  'strong',
  'link',
  'blockquote',
  'delete',
  'list',
  'listItem',
  'heading',
  'code',
  'thematicBreak',
  'table',
  'tableHead',
  'tableBody',
  'tableRow',
  'tableCell',
  'html',
]

const markdown = "<a href=\"https://en.wikipedia.org/wiki/HTM\">HTML</a>, and will require the <code>html-parser</code> AST plugin to be loaded, in addition to setting the <code>escapeHtml</code> property to false."


<ReactMarkdown
          source={markdown}
          allowedTypes={allowedMarkdownTypes}
          escapeHtml={false}
          linkTarget='_blank'
/>

image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    🌊 blocked/upstreamThis cannot progress before something external happens first🐛 type/bugThis is a problem

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions