Forums

Why does HTML mode add tags? (8 posts)

  1. _Lesa
    Member
    Posted 2 months ago #

    When creating a post in HTML mode, I don't want it to add <p> or
    tags. That behavior should be reserved for visual mode.

    This is not a case of switching between visual and HTML mode. I don't want to use visual mode at all, and I just want HTML mode to work like a regular text editor, without assuming I want a line break just because I used a carriage return. It's bad enough that I have to use workarounds on my own site, but now I'm doing a site for somebody else and don't want them ripping their hair out over this.

    Which js file do I need to edit in order to change this behavior, so HTML mode doesn't add any of its own tags, and what code within that file do I need to change? If you can just point me to the file but don't know the code, I can try to figure it out from there.

    Thanks in advance.

  2. esmi
    Member
    Posted 2 months ago #

    I just want HTML mode to work like a regular text editor, without assuming I want a line break just because I used a carriage return.

    And how exactly do you think WP should parse your carriage return? Should it just ignore them?

  3. _Lesa
    Member
    Posted 2 months ago #

    Looking at your profile, esmi, I have to wonder if that is a serious question. When I put a line break in my code to make it readable, it's just to make the code readable, and nothing more. What is the point in having "HTML mode" if it doesn't give us complete control over the HTML?

  4. esmi
    Member
    Posted 2 months ago #

    The problem you have is that the HTML tab isn't a true text editor. The content is still parsed for - amongst other things - shortcodes and the <¬1--more--> tag. Remove all parsing and you take away that functionality - which is why I assume that the basic parsing stays.

    One way around this might be to edit your theme templates to use $post->post_content in place of the_content() or the_excerpt(). But if you want to hack the core files, I think you'll find the relevant code is in wp-includes/post-template.php.

  5. samboll
    moderator
    Posted 2 months ago #

    Looking at your profile, esmi, I have to wonder if that is a serious question

    personal attacks will not be tolerated

  6. _Lesa
    Member
    Posted 2 months ago #

    Thank you, esmi. I'm not really sure what to look for, but I'll check out that file and see if I can figure it out. :)

    samboll, it was an honest statement, and I'm sorry if you took it as a personal attack. esmi seems to understand where I was coming from, and I'm grateful for his/her help.

  7. _Lesa
    Member
    Posted 2 months ago #

    Reading that post again, am I to assume that editing the template files will render the <!--more--> and other WP-specific tags useless? I only want to prevent automatic line breaks and paragraph tags, and will occasionally want to use the tag that paginates a post.

  8. kvcrawford
    Member
    Posted 1 month ago #

    Use the Raw HTML plugin - http://wordpress.org/extend/plugins/raw-html/

    That way you don't have to do any hacking, so everything will be safe to update.

Reply

You must log in to post.

About this Topic