Switching between Text/Visual Editor makes HTML tags disappear
-
Hi there,
I’ve been using HTML tags in pages with the Text editor (the ones supported by WordPress.com, as listed in their webpage). These tags work perfectly fine when I hit Publish or Preview the page. So far so good.But if I go back to edit the page containing the HTML tags after I edited another page with the Visual Editor, the Editor has switch from Text to Visual (I guess WP by default starts the last used Editor), which makes some tags disappear when hitting the Update button.
I have detected this problem with the <address> tag. Is this a known WP (Visual or Text Editor) issu?
Thanks for your answers.
The blog I need help with is: (visible only to logged in users)
-
In general, the editor removes
a) plain p and br tags (they will be present in the actual sourcecode of the page, but they are hidden from view in the editor, to avoid unnecessary clutter);
b) wrong or forbidden coding;
c) tags that are or seem useless (for instance span tags without the style attribute).There should be no problem with the address tag in particular. How exactly did you try to use it?
-
Hi justpi,
I tested the address tag as follows:
<address>This is the address tag</address>
Is this wrong or useless? -
No, and it shouldn’t be removed when you switch to Visual (in my editor it doesn’t).
Note, for possible future questions on coding: in most cases, to display code here correctly you need to enclose it in backticks (see the note on “allowed markup”).
-
Hi justpi,
weird!
maybe it depends on the browser…
I don’t know the “allowed markup” note you are referring to. For me, this is the page describing allowed markup: http://en.support.wordpress.com/code/#html-tags
I’ll try the backticks in the Visual Editor as you say, could be that… -
No, the backticks are not for the Visual editor. The backticks are to make code display HERE so we can analyze it.
If switching between editors strips out your code, then I recommend you not do that.
-
I guess if there is no better way to go … I wanted to highlight this problem in case this is a WP bug or other.
-
Then learn to use backticks to demonstrate code in a forum. If you had a public blog, we could analyze the sourcecode, but you don’t, so this is basically your only option for help with code issues.
-
I was referring to “future questions on coding”, so, as raincoaster said, “here” meant here in this forum. The note on allowed markup is also here (left of reply field).
-
-
I think I have a similar problem, randomly happening when I switch back and forth from Visual to text editor. Here are a few lines of a bash script, how they appear when the issue happens:
[sourcecode language="bash" light="true"]if [ "$post" = "finito" ]<br />then<br />exit[/sourcecode]
Before that they were recognized correctly both by visual and text editor. Namely, “
” weren’t seen and double quotes were printed literally (I mean not as "). -
ops… when submitting the forum entry the HTML codes are recognized correctly. I meant: < br / > are shown and double quotes appear as & amp ; quot ; (remove spaces :-) )
- The topic ‘Switching between Text/Visual Editor makes HTML tags disappear’ is closed to new replies.