kadikraman / draftjs-md-converter

Converts content from Draft.js blocks to Markdown and vice versa.
https://kadikraman.github.io/draftjs-md-converter/
MIT License
145 stars 37 forks source link

Incorrect parsing of MONOSPACE / inline code #77

Open imp-dance opened 2 years ago

imp-dance commented 2 years ago

Steps to reproduce

  1. Try to parse markdown that contains inline-code formatted with "`".
const test = "`A quick brown fox...`";
const result = mdToDraftJs(test, { MONOSPACE: "`" });

Expected results Editor outputs a formatted monospace "A quick brown fox...".

Actual results Editor outputs an unstyled block with the backticks stripped away: "A quick brown fox...".


One would expect the editor to output a inline-code formatted block (called monospace in Draftjs). But instead, mdToDraftJs seems to strip away the "`" and output "test" instead.