Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Tiny is changing the HTML unexpectedly although HTML is valid

Aperta
#11,250 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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

type: bug

📝 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:

Image

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:

Image

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

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di tinymce/tinymce

Tutte le issue di tinymce/tinymce

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.