WordPress.org

Ready to get started?Download WordPress

Forums

HTML Input is changed in an 'stupid' way (19 posts)

  1. Pospiech
    Member
    Posted 8 years ago #

    I am new to wordpress and tried to convert part of my old html side (www.matthiaspospiech.de) to wordpress.

    The old side is completely selfmade html+css based. So for example a linklist looks like this:

    <a name="sprache"></a>
    <div class="floatitem">
    <h3>Sprache</h3>
    <div class="linkitem">
    <ul class="linkitem">
    <li><a href="http://dict.leo.org/?lang=de">http://www.leo.org/ (englisch-deutsch)</a></li>
    <li><a href="http://dico.leo.org/?lp=frde">http://www.leo.org/ (französisch-deutsch)</a></li>
    </ul>
    <a href="#top"><IMG src="/images/squareup2.png" width="11" height="11" border="0"></a></div></div>

    which I changed to
    <a name="sprache"></a>
    <h3>Sprache</h3>
    <div>
    <ul>
    <li><a href="http://dict.leo.org/?lang=de">http://www.leo.org/ (englisch-deutsch)</a></li>
    <li><a href="http://dico.leo.org/?lp=frde">http://www.leo.org/ (französisch-deutsch)</a></li>
    </ul>
    </div>

    but, wordpress changed this to:

    <a name="sprache"></a>
    <h3><a name="sprache"></a>Sprache</h3>
    <a name="sprache"></a>
    <div><a name="sprache"></a>
    <ul><a name="sprache"></a>
    <li /><a href="http://dict.leo.org/?lang=de">http://www.leo.org/ (englisch-deutsch)</a>
    <li><a href="http://dico.leo.org/?lp=frde">http://www.leo.org/ (französisch-deutsch)</a></li>
    </ul>
    <div>

    and that is really stupid.

    Questions: Is there a way to get around such problems. And are there special rules of 'valid' html for wordpress ?

    Just curious.
    Matthias Pospiech

  2. manstraw
    Member
    Posted 8 years ago #

    not enough info. where exactly is wordpress "changing" this.

  3. Pospiech
    Member
    Posted 8 years ago #

    I typed this in at the editor with html view. After saving this text and later opening this for editing this text again the html code was changed to what I posted.

    Matthias

  4. Chris_K
    Member
    Posted 8 years ago #

  5. Pospiech
    Member
    Posted 8 years ago #

    I am sorry. but I do not see the connection between editing Pages and changing the theme.

    Matthias

  6. Chris_K
    Member
    Posted 8 years ago #

    But perhaps I'm misunderstanding what you wish to accomplish.

    Other options:

    Options -> Writing. Disable "WordPress should correct invalidly nested XHTML automatically"

    Use the HTML button from the Wysiwyg editor to add html code.

    Turn off the Wysiwyg editor. Users -> Your Profile. Scroll to the bottom and uncheck "Use the visual rich editor when writing"

  7. Chris_K
    Member
    Posted 8 years ago #

    convert part of my old html side (www.matthiaspospiech.de) to wordpress.

    That struck me as theme related.

  8. manstraw
    Member
    Posted 8 years ago #

    gotcha

    the roles manager plugin give you access to a setting for unfiltered html. I haven't tested it though.

    there is also a setting in each user profile for using the visual editor, which you might need off.

    and if those don't do it, you can turn off filtering functions by adding something like this to functions.php in your theme:

    remove_filter("the_content", "wpautop");

    cruise the wordpress file functions-formatting.php for to see what other filters you might be able to turn off.

  9. KevinTMC
    Member
    Posted 8 years ago #

    I am having this same problem, and have been wondering if it is a bug.

    Here's what happens. I am editing one of my Pages in the visual rich editor, and I insert an anchor into the text. At first it works fine.

    But if, at any time thereafter, I enter the HTML editor when editing the page, then close it after making any changes by clicking the Update button...

    ...suddenly there are multiple copies of the [a name=][/a] tag scattered throughout my text. The copies appear to be placed after every [p] tag, and also between every [/p] and the following [p], from the original tag on down to the bottom of the page.

    [rant]
    My preference when writing and editing posts and pages is to use the visual rich editor primarily, dropping down to the HTML source when necessary. But if tinyMCE is going to fight me by changing and rearranging and screwing up what I've manually put into the HTML source editor, it defeats the purpose of having that option in the first place. So I suppose it's time for me to figure out how to disable the visual rich editor altogether.
    [/rant]

  10. Yngwin
    Member
    Posted 8 years ago #

    I hear you. First thing I did when I upgraded to WP 2.0 was to turn off the tinyMCE "visual rich" editor. I like to have complete control over my code.

  11. Chris_K
    Member
    Posted 8 years ago #

    you could also, of course, disable the "correct bad xhtml" option at options -> writing.

  12. KevinTMC
    Member
    Posted 8 years ago #

    Yes, I thought that would fix the problem too.

    It doesn't.

  13. Chris_K
    Member
    Posted 8 years ago #

    It fixes some, but yeah... not all. I had issues with list nesting and such and unchecking that helped.

    Now I just turn the damned thing off (as already noted above). Problems solved.

  14. Samuel B
    moderator
    Posted 8 years ago #

    Hey Handy - congrats on your promotion!

  15. KevinTMC
    Member
    Posted 8 years ago #

    Hmm. I've found an unexpected downside to turning tinyMCE off.

    Now I can edit the HTML and it stays edited...

    ...except for the [p] and [br] tags, which don't show up at all! Gaaah!

    Any way to see these and make sure they're correct in the plain-jane editor? (They showed up just fine in the HTML source screen in the fancy visual editor thingy, even if they did funny things once I clicked the Update button.)

  16. lhk
    Member
    Posted 8 years ago #

    Hi,

    yeah, the last one also drives me nuts.

    What I don't really understand is why both settings are not truly separate like this:

    - WYSIWYG: includes auto-correction

    - base editor: allows FULL manipulation of html

    Right now WP competes with TinyMCE, both types of editors are not fish not meat, both change input, both allow raw html input, both manipulate input on saving, and the user has NIL chance to define what will happen.

  17. Yngwin
    Member
    Posted 8 years ago #

    WP uses different 'filters', some of which can be turned off in the admin interface. Now it would be good if we would have full control over all filters, but currently that is only possible by editting the WP code directly, or by using a special plugin (which I don't think exists yet).

    The filters can be turned off by commenting them out in wp-includes/default-filters.php and their functions are defined in wp-includes/functions-formatting.php. You are probably looking for the wpautop one.

  18. KevinTMC
    Member
    Posted 8 years ago #

    Thanks for the wpautop reference. Googling that led me to a couple of promising plugins. Trouble is, one of them has no documentation at all, and the other confuses me (and hasn't been updated for a while either).

    Anyone have any insight into either:

    Disable wpautop Plugin:
    http://www.urbangiraffe.com/plugins/disable-wpautop/

    Text Control:
    http://dev.wp-plugins.org/wiki/TextControl

    For that matter, I am having a hard time finding a good thorough reference on wpautop itself and exactly what it does and how it works.

    Which makes it very hard, for instance, to make sense of the rumblings I hear about having to go back and fix old posts if you turn wpautop completely off.

  19. manstraw
    Member
    Posted 8 years ago #

    in simplistic terms (the only terms I know for this topic!) wpautop runs through the entry just before it displays, and tidies up the output. with the plugin activated, it doesn't do that. wpautop doesn't touch the entry itself. it only filters the output each and every time it's displayed. so yeah, turn off the disable wpautop plugin, and that filtering process happens again, which may result in the output not being as desired.

    You can also do it on a theme by theme basis by putting the necessary code in the functions.php of a theme. add to, or create functions.php in your theme, and make sure it contains:

    remove_filter("the_content", "wpautop");

    that needs to be inside <?php ?>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags