vaakash / git-it-write

A WordPress plugin to publish markdown files present in a Github repository as posts to WordPress automatically.
https://www.aakashweb.com/wordpress-plugins/git-it-write/
GNU General Public License v3.0
45 stars 22 forks source link

URL meant to be left as plaintext for WordPress to process is instead being converted on GIW sync #45

Closed SienciLabs closed 1 month ago

SienciLabs commented 2 months ago

Hello @vaakash!

Thanks for your prompt reply on my previous comment. I've since nearly achieved full compatibility of your plugin with my documentation site but there's still one issue remaining that I could use your help with:

  1. In WordPress, if you were to put in the text https://www.youtube.com/watch?v=dQw4w9WgXcQ then it would format the plain text into a YouTube video player
  2. The problem is that if I put this text into a .md file, then use Git it Write to sync the file to WordPress, then it gets formatted into <a href="https://www.youtube.com/watch?v=dQw4w9WgXcQ">https://www.youtube.com/watch?v=dQw4w9WgXcQ</a>
  3. I've tried many things to stop this formatting from happening like using escape characters, span, <p> tags, <br> in <p> tags, and more and every approach I've tried so far hasn't worked

My question is: is there another way you can think to send the link as plain text - or - is there a way to add an exception to the plugin to cancel the auto-formatting? I could edit the plugin locally if you don't want to make it a permanent version change.

Thanks for the help. By the way if you're interested, this is the repo that I've been setting up to use your plugin for syncing: https://github.com/Sienci-Labs/Resources

vaakash commented 2 months ago

Hi @SienciLabs,

Thanks for the report. I'll look into this and see if it is transformed by parsedown or WordPress. My guess is it should be by WordPress. There should be some hook to disable this. I'll check and update.

SienciLabs commented 2 months ago

Thanks for checking it out @vaakash, good luck. I've found it also can happen even inside a shortcode so it's disrupting GIW in 3 different ways so far unfortunately, but if this helps out it seems like <a> links are being imported fully correctly

If there's any way I can help out please let me know.

SienciLabs commented 1 month ago

HI @vaakash, I think I found the source thanks to Walid who's on our team and helped me out. In includes ➜ parsedown.php ➜ line 55

If you paste in: public function inlineUrl($excerpt) { return; }

Then it seems to strip out URL formatting and it arrives on the other end of WordPress correctly. Would you like me to submit a PR for this?

vaakash commented 1 month ago

Hi @SienciLabs, Thanks for the analysis. I'll research further on this and publish a release after regression tests.

vaakash commented 1 month ago

Hi @SienciLabs,

This issue is fixed in v2.0. Please update the plugin to the same.

SienciLabs commented 1 month ago

Amazing! Glad to hear