• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Will Angley

Just another WordPress site

  • About
  • Photos
  • Words
  • Resume
  • Contact

Marking myself into a corner, part 2: wpautop

January 6, 2021 by Will Angley

Previously: Marking myself into a corner, part 1

I found unexpected paragraph breaks in a post I’d written in Markdown, and copy-pasted into WordPress, about a day after I published it.

Clicking Edit showed I had line breaks in the Markdown source where there were paragraph breaks in the published post. I recognized this as WordPress’s wpautop filter, which uses different rules to place paragraph breaks than Markdown. A quick search shows this was reported upstream and closed as infeasible: jetpack#1965

I worked around it by deleting the line breaks.

Can I fix this with a plugin?

I tried dealing with this by using a plugin, Toggle wpautop, but found that wasn’t the right thing either; Jetpack Markdown relies on having wpautop active.

This is the second time I’ve encountered this; the first time was in 2019, when I was looking at moving from Hugo to WordPress. I felt overwhelmed and gave up on the project then.

This time, I looked back at the Jetpack issue, and saw there’s a workaround: calling wpautop( $content, false ); will do the right thing for Markdown posts. I haven’t found a plugin that implements this, but I might be able to patch it in to the one I’ve found…

Filed Under: Words

About the Author

Will Angley likes to take photos, and pays the bills by writing code for a big company.

Never miss a post!

By clicking submit, you agree to share your email address with the site owner and Mailchimp to receive marketing, updates, and other emails from the site owner. Use the unsubscribe link in those emails to opt out at any time :).

Primary Sidebar

Follow me

  • GitHub
  • Instagram
  • LinkedIn
  • RSS
  • Twitter

Top Posts

  • How I set up Tailscale on my WiFi router

Recent Posts

  • ✅ Visual glitches should be fixed now!
  • 🐞 Visual glitches on older posts
  • Make Logitech G PRO X TKL macros ready sooner
  • Returning the Logitech G PRO X TKL to wired mode
  • 🗽Statue of Liberty

Categories

  • Photos
  • Words

Copyright © 2014–2025 Will Angley · Privacy Policy · Made with ❤️ and WordPress in NYC