Open jashsayani opened 4 years ago
When migrating the articles, the original <img>
will be converted to Markdown, stripping its attributes in the process. After migration, it's up to the theme how to display the image.
While it's possible to style the image without using custom class, but if you need to add it, you can use the filter API to insert it.
If the attributes are stripped while conversion, how will the theme know how it was set in wordpress? The attributes should be preserved, so images can be floated left or right.
Unfortunately, there is no way of doing this on plain markdown. We'd have to use HTML instead to make it work on Hexo side. We can have a parameter to retain these attributes.
There are plugins to achieve this. But as far as I've looked, they are complicated to use and not portable (if we need to use the markdown outside of Hexo for example they would need further processing). Optional parameter to include HTML with attributes would be a great balance I think.
The attributes should be preserved, so images can be floated left or right.
I think WordPress adds a ton of attributes to images. Can you list some attributes, other than alignment, that you are interested in? It will help us determine how we can solve this.
Wordpress composer lets you set images to float left, right or be centered in the post. Migrated posts always center the images instead of respecting image attributes set on the image in wordpress.
Original posts:
Migrated result: