jodit / jodit/jodit-react

Switching to source mode changes editor value

Open
#56 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
406
Forks
131
Avg merge
2h 32m
Merged PRs (30d)
2

Description

When switching to source mode (the first time), the value of the editor is changed:

  1. The html tag surrounding the content is stripped
  2. Some new line characters (\n) are added

Whereas the first issue is a disaster, because html wrapper contains information relevant for backend. The second issues is also nasty, but is fixable.

How to reproduce: init JoditEditor with value f.e.
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"><head><style>body{font-family:"Verlag Office",Verdana,Sans-serif; font-size: 14px;}</style></head> <body> <h2>hello</h2>/body></html>
Switch to source mode, console.log the value of the editor.
Result: tag is removed.

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 the JoditEditor entry point and trace the first transition into source mode while logging the editor value. Reproduce the case with the provided XHTML wrapper, then verify that the html tag and surrounding content remain intact and that no unintended newline characters are added.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.