Automatically convert HTML codes

cajkan

Active Member
Hello VL,

Recently i had small problems with html tags, example :
&nbsp &amp <em> <i> <div></div>

1. Some users register into our sites with "&" - test.com/something.php?page=reward&i=4
2. Into custom page editor, if we add some empty div class - <div class="line"></div>
This div gets automatically <div class="line">&nbsp</div>, now the next time you save the page that element will not appear into the page.
3. <i> - Mostly used for custom fonts, and other stuff, this tag automatically gets <em> tag, once its saved the page.

Now if we run any validator ( im using http://validator.w3.org/ ", we get errors for all thouse tags.
Now my request is "&", "?", etc.. this tags to be converted automatically as &nbsp &amp <i> <div></div> etc...
 

Mark

Administrator
Staff member
1) & and &amp; are the same thing. &amp; is correct and necessary for validation, it really should not cause any problems. Are you experiencing problems with it?

2) make sure when your adding code you add it using the source tab. &nbsp is what happens when you leave a white space, this is correct.

3) this appears to be the work of tinymce, you can read hear how to change that behavior. http://stackoverflow.com/questions/...inymce-does-not-convert-b-tags-to-strong-tags
 

cajkan

Active Member
1) There arent any problems, but there are errors into validations.
2) Always using source code, but same thing happens - you can test it.

Ive reported this, so VL hopefully can improve that field.
 
Last edited:

Mark

Administrator
Staff member
1) & is NOT valid. &amp; IS valid.
2) I will test further
3) this is NOT a glitch, its a FEATURE of tinyMCE. You can change the behavior to suit your needs.
 
Top