Rebaking is done. What a messy result!
Well, now I know why this option was disabled.
We are using Wordpress and the first post contains full html. Discourse has no issue to replace image HTML with markdown, but markdown image can’t be rendered if surrounded with HTML (or specifically you need a least en empty line above).
I have 2 problems:
Some images were not downloaded, likely because of
srcsetattribute (but it’s okay). The images are well displayed in the first post, but there is no thumbnail generated. It was working before.
Is there some breaking change in the plugin where thumbnail can’t be generated with post containing already image HTML? I believe I’ve rebaked 3 times now, it did not help. Is there another to force regenerate the thumbnail? I mean, before, even with the option disabled, a thumbnail was generated with any image on topic creation or even after editing it ; this behavior doesn’t work anymore.
As said above, some markdown image are not rendered.
I tried to see if some plugin API was available before post is cooked, but could not find one.
I guess the only way is to add newlines in the concerned raw message directly in the DB and through the rails console, and rebacking again.
Currently, I’m struggling (don’t know ruby) somehow based on discourse code source:
It seems to work for one topic. Did not yet execute for all topics. Is there a better/cleaner way to fix the issue without doing that?
Post .where(post_number: 1) .where("raw LIKE '%upload://%'").each do |post| post.raw.gsub!(/(!\[.*upload:\/\/.*\))/, "\n\n\\1") post.save!(validate: false); post.rebake! end
Any help is appreciated, thanks!