Closed KillianKemps closed 8 years ago
This is rather odd, as mechanically the plugin is rather simple, and it works of the standard Markdown content produced by Grav. With the newest version (v1.2.0) your result should be the second example with the source still in the img
-element, and the configuration is as simple as either enabled: true
or false
.
Are you using any other plugins which manipulate images, or processed Markdown? Would you mind sharing a sample of the Markdown which produced this behavior? Also, do you get any PHP-errors with it enabled?
Thanks for your rapid answer.
All other plugins I use are from the official Grav team. Here is the list of all 11 enabled plugins:
I have no errors in Grav's logs since I tried your plugin :/
Checking again my blog posts, it seems some are not affected by the plugin, but others are completely empty. One good news: it seems that the plugin works well for some of my blog posts.
For example, here is a screenshot of some blog posts on my website:
You can see below the whole content of one concerned blog post :
The logo you see at the top of my website has been made three years ago during
a work at school called "personal branding". At this time, I wasn't very
familiar with tools like Adobe Illustrator and I wasn't very good at graphical
work. I will describe in a later post how I designed my new logo with
Inkscape, but I will explain here what are the reasons why I designed it like
this.
===
First, people may ask why do I wish to have my own logo when I'm not a
company. My use of personal branding is not to be able to do advertising or
other form of communication. In fact, I may use this logo only on my website,
my CV and my visiting card. So, only mediums that I own. Having a visual
identity helps people to distinguish a part of my personality and have a brief
overview of my profile. Between a developer having a website styled like a
terminal with linux command line entries, and another developer having a
website using Google's Material design, you already see there is a distinction
between a Linux-fan and a Google-fan developer.
![](logobarreskilliankemps_bleu_v2.png)_My previous logo_
It took me a lot of time to design my logo. Even with the help of Antoine
Beauvillain, who gave me some inspiration and helped me to design the first
iterations, it took me more than two weeks to finally know what I want. I may
publish a later post on the process of designing the logo and the intermediate
logo I got.
So, these are the principles I had in my mind when I designed this final logo:
1. Follow KISS principle
2. Should not be about coding (even if my blog is a lot about technology)
3. Should define me in every domain
After having thought a long time about it, I decided to do something with
time. Because in everything I do, I pay attention to time like an obsession
and I always try to optimize what I'm doing. Also, I have worked, and am
working, on some projects related to time management while some other projects
are still ideas on paper.
Trying to represent time, I searched everything which could be related, from
watch to sand-glass. But I found all this representation to complex (I remind
you that I wanted to follow the KISS principle), so I ended up with this
spiral form. The reason is that philosophers like Bergson say that time rolls
in itself and I'm really interested to consider time differently as just a
cycle. Time is like an undended flow which can't stop.
![](logo_final.png)
_My final logo after two weeks of research_
Well, what are your impressions? I'm also going to redo my website, so you
will see a new design in a short time.
Couldn't you develop your plugin in order for it to only change the content if a title has been given for an image? Because I see that even if my images have no title, just the source, your plugin changes it to figure
tags.
The first version (1.0.0) only applies the change on images with a title set, but this leaves some inconsistency in semantic structure (though I just noticed I forgot to update the README for the current version).
None of the plugins you list will break the ImgCaptions-plugin, but unexpected markup might - the inevitable failing of Regex, though Markdown is usually quite consistent in output. To check this, I ran your Markdown with a current Grav-installation and you have definitely found a bug where the coverage of my test cases clearly were not sufficient.
I'm going to revise the mechanisms to check this, as I still believe the "Transport class-attribute" change is worthwhile. Meanwhile, v1.0.0 should work as expected for you. And thank you for taking the time to report the bug, might have been overlooked if not!
Ok, I have located and solved the issue. In a nutshell, the Markdown code needs to be "cleaner", specifically, this:
![](logobarreskilliankemps_bleu_v2.png)_My previous logo_
Should really be this:
![](logobarreskilliankemps_bleu_v2.png)
_My previous logo_
This is semantically more correct as the image is a block-element, not an inline-element, and thus the image and the text should not be wrapped in the same paragraph.
That said, I split the first regex-mechanism to compensate for this. Even with the text inline, it now processes as expected. However, the <em>My previous logo</em>
is then not wrapped in a paragraph, because of the above. v1.2.1 should update on the gpm soon, and is immediately available here on GitHub.
Great! It works now for all my blog posts. Thanks a lot for your fix.
For the "dirty" Markdown, the explanation is that I migrated my website from another CMS to Grav and I wrote a script to convert posts from XML to Markdown. But the original XML was quite dirty so the conversion was not perfect.
👍
(I think you forgot to update the version number in the blueprints.yaml of your plugin. It still shows 1.0.0 and it's maybe the reason why I couldn't update from the admin)
Oh, you are correct. Way too many places to bump that version number! Glad that it works now, and thanks for using and providing feedback.
Hello,
Thank you for your plugin which seems interesting.
I tried your plugin, but I had several issues:
to
but.. the
figcaption
remained empty :/What is your configuration to make it work?