• 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.

Viewing 7 replies - 1 through 7 (of 7 total)
  • 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?

    Thread Starter _lesa

    (@_lesa)

    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?

    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.

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

    personal attacks will not be tolerated

    Thread Starter _lesa

    (@_lesa)

    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.

    Thread Starter _lesa

    (@_lesa)

    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.

    Use the Raw HTML plugin – https://www.ads-software.com/extend/plugins/raw-html/

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

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Why does HTML mode add tags?’ is closed to new replies.