I have been struggling for about 3 hours, both testing solutions and googled as a maniac. I haven't found any solution to this specific problem.
Problem: TinyMCE wont allow me to insert text as a direct "child" in:
<table>
<tr>
<tbody>
Example: I use TinyMCE Option > Source Code.
Input:
<table>
<tr></tr>
*[generated]*
</table>
When I then press "OK" on the Source Code window the output is the following:
*[generated]*
<table>
<tbody>
<tr></tr>
</tbody>
</table>
What happens is that TinyMCE validates the markup as invalid and adds my "text" ([generated]) outside the table.
WHY: I want this solution because a cms engine takes the static HTML and find special elements to insert data dynamic data. The data will contain valid HTML and my [generated] tag will not exist in the generated page afterwards.
What I have done? I have been trying:
extend_valid_elements: "table[#text], table[text], tr[#text],tr[text]",
valid_elements: "table[theader|tbody|#text|]",
valid_children: "table[theader|tbody|#text]"
I cant possibly paste all different elements I have been trying to allow with. But now I am out of ideas. And I dont want to cook a dirty hack for this.
Is there anyone out there who can help me? My settings is all standard, I have just added som plugins.
verify_html: false, cleanup: false,
But whatever plugin/setting that makes this, I will remove.
English is not my mother tounge, but I'll hope I made myself clear.
tbody
withvalid_elements: "table[theader|tbody|#text|],tbody[tr|#text]", valid_children: "table[theader|tbody|#text],tbody[tr|#text]"
– elixenide