-
Notifications
You must be signed in to change notification settings - Fork 559
Enhanced Post.FirstImgSrc method to really find the first image #172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…e content using regular expressions. The previous code didn't find images with styls or other attributes and that was a problem. Bumped minor version to reflect change.
I think this project has low activity now, but this helped me! Thanks |
Thanks. Happy to help. It's a pity that a lot of projects in the .NET world, used by thousands of people, get abandoned 😞 |
There is a conflict since this is way old. The best solution to this is to let the admin upload it from the settings. which will be the default post cover. But again, what if the theme doesn't support the cover. But for now, I think the best default image would be a "data:image/svg+xml" like below that shows the Blog Title in the center of the image:
Anyways, I'm closing this, If you wish to make the changes, please open this with the updates. |
Hi: I was just rewriting an already existing method to make it a little better. The problem with the conflict is that my PR is more than 3 years old, and the first response by a maintainer is just now 😒 If there's no image there's no problem at all (the same way that wasn't a problem before). It's just a better regular expression, that's it. I agree on BlogEngine not being the best option to create a blog today with .NET, but if you have been using it for decades and have thousands of posts and comments (like myself), maybe you don't have a good chance to do a proper migration. My other blog, smaller, it's already migrated to a different system log ago. My main blog, unfortunately, it's not as easy to migrate without loosing a lot of info or without glitch. Cheers! |
Jose, Blogifier is under development. But already, you can import RSS. and all of your posts, files, categories will be imported. |
Hi @farzindev Don't worry, I totally feel you, as I'm maintaining some projects by myself too (less popular, of course). But sometimes written communication can be misleading and one can sound harsh. Sorry about that. Thanks! |
Hi:
I've just changed the
Post.FirstImgSrc
method's code to really find the first image in the post content using regular expressions.The current code didn't find images with styles or other attributes, and that was a problem since a lot of people include images with different styles or alignments such as:
The current method only finds images that start exactly with:
My change is 100% compatible with the previous but uses regular expressions to really find the first image in the post contents.
Bumped minor version to reflect change.
Thanks!