Tiny is changing the HTML unexpectedly although HTML is valid
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- frontend
Direzione di ricerca
Reproduce the behavior in TinyMCE 8.2.2 using the supplied image, span/link, and empty div examples. Compare the editor output with the valid original HTML, focusing on added paragraph elements, removed spans, and inserted whitespace. Done means valid HTML is preserved without unnecessary tags or whitespace while the reported cases remain supported.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
📝 Provide detailed reproduction steps (if any)
We're about to use TinyMCE in Moodle 4.5 and 5.2, but we're facing some issues because TinyMCE edits the HTML unexpectedly. We're facing the following issues:
HTML contains a simple image
- Original:
<img class="img-fluid" alt="" width="200" height="284" src="https://someimage"> - TinyMCE:
<p><img class="img-fluid" alt="" width="200" height="284" src="https://someimage"></p>
But according https://validator.w3.org it's not necessary to add a <p> tag:
Besides this, Tiny is adding very often <p> tags. For example a simple <span>text</span> becomes <p>text</p>. Also when I've <a href="https://test"><span>some text</span></a> it becomes like this: <p><a href="https://test">some text</a></p>
But a span inside a link is valid and a <p> not necessary:
I already discussed these issues in the Moodle developer chat and they told me that these issues are not related to Moodle itself, but to TinyMCE and I should open a bug issue here.
Adding whitespaces
- Original:
<div class="test"></div> - TinyMCE:
<div class="test"> </div>
Tiny simply adding a whitespace between both <div> which is unnecessary and causes the page in some cases to break or not be aligned.
✔️ Expected result
TinyMCE should not add additional tags or remove them.
❌ Actual result
What is the actual result of the above steps?
For our customers it causes trouble because it affects the layout of the course and activity pages in Moodle.
📃 Other details
- Browser: Google Chrome
- OS: Windows 11
- First affected version: 8.2.2
- Worked in version: Never as far as we know
If you'd like to see this fixed sooner, add a 👍 reaction to this post.
- Lingua principale
- TypeScript
- Stelle
- 16.3k
- Fork
- 2.3k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di tinymce/tinymce
-
type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
-
type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
status:stale
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Tutte le issue di tinymce/tinymce
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
bcgov/bc-wallet-mobile#4761 · 1 commento ·
-
external-issue to-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
area-deployment area-integrations triage:bot-seen
Difficoltà 2/5 Mezza giornata Idoneità per principianti 86/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
refactor
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100