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

Bug with code block #36

Closed
andrewfan opened this issue Apr 28, 2018 · 2 comments · Fixed by #49
Closed

Bug with code block #36

andrewfan opened this issue Apr 28, 2018 · 2 comments · Fixed by #49

Comments

@andrewfan
Copy link

Hey, I have a value

  some text
   \```
   some code 
   \```

and draftjsToMd returns everything wrapped in ```

i think it happens here /~https://github.com/kadikraman/draftjs-md-converter/blob/master/src/draftjsToMd.js#L180

For now i fixed it with

   let newString += block.text.split... 
   ....
   newString = applyWrappingBlockStyle(block.type, newString);
   newString = applyAtomicStyle(block, raw.entityMap, newString);
   returnString += newString;
@kadikraman
Copy link
Owner

Hi @andrewfan so sorry, I don't know how I missed this issue! I'd love to fix it, but I can't seem to write a test to replicate it. Am I understanding correctly that inputting

some text
\```
some code 
\```

will return the equivalent of this when rendered in draft.js?

\```
some text
some code 
\```

@insaindesign
Copy link
Contributor

Created #49 with test case and fix

kadikraman pushed a commit that referenced this issue Jun 26, 2019
* Fix code block wrapping whole document (#25)

* Fix lint issues
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants