Closed garfieldnate closed 6 years ago
It looks like I mistakenly put the width and height in the wrong place in this image tag, so that jekyll interprets them as classes. It is not what I intended, but it is still a legal image tag.
The problem is that this regex assumes only one class, but jekyll's image syntax allows for multiple classes. You can see here that the regex does not match my image tag, but it does match if you remove the two numbers from the tag.
Another problem with this regex is that it assumes that the class names will only consist of letters, which is definitely not always true. Class names often contain dashes or numbers. Apparently they can also contain dots and colons. I don't think it's useful to be strict about this anyway, because when using the converter I just want a conversion, not html syntax checking.
To fix this specific problem, replace the regex on line 584 with the following regex:
{%\s+img\s*((?:[^\s/]+\s*)*)\s+([\S]*\/[\S]+)\s+(\d*)\s*(\d*)\s*(.*?)\s*%}
The class-matching portion matches 0 or more words (any character separated by white space). I also disallowed /
in the class names to prevent catastrophic backtracking by avoiding matching the URL.
I have other doubts about this section of code, though. A URL doesn't have to have a slash in it, if the picture is in the same directory. Also, the section on parsing title and alt-title is overly simplistic. There could be several clitics (don't, didn't, etc.) in the text, and the author could be using double quotes instead of single quotes. A generic split is going to run into problems.
This issue has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help.
If this is a bug and you can still reproduce this error on the master
branch, please reply with all of the information you have about it in order to keep the issue open.
If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.
This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
I'm trying to convert my jekyll site (source here: https://github.com/garfieldnate/garfieldnate.github.io). I use the following command:
Here's the output:
Looking at the output, only the first post was converted. Since the error message indicates a problem with converting an image tag, perhaps the problem is this tag, found in the second post: