jpuri / jpuri/draftjs-to-html

Unnecessary new line \n character

Open
#89 4 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
325
Forks
139
PR merge metrics
No merged PRs in 30d

Description

Hey @jpuri !

I was trying to convert a draft to html. While doing so, I was running to an issue that each block was seperated by a \n character. This seemed to be originating from https://github.com/jpuri/draftjs-to-html/blob/c02452e3ce6719f84f38d39f8f9b0a9e32bf871f/lib/draftjs-to-html.js#L615

Is there any workaround where the new line character is not the delimiter?

Thank you

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at lib/draftjs-to-html.js around line 615 and trace how blocks are joined during draft-to-HTML conversion. Reproduce the issue with multiple blocks and verify that the output no longer includes an unwanted \n delimiter while retaining the expected HTML structure.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.