Closed sankoshine closed 4 years ago
@sankoshine Do you have a copy of the markdown you were trying to convert? It would be nice to add a test for this issue doesn't crop up in the future.
I going to have to give this some more thought. We definitely want to convert images in paragraphs, but it would be nice to have this be less specific to one corner case of markdown and see where the underlying problem is (perhaps treating paragraphs as dummy containers until the very end of conversion...)
I tried your hexo example and found even the simplest markdown doesn't work:
---
title: "foo"
date: 2010-04-24 17:06:00
tags:
categories:
---
![bar](img1.jpg)
Odd, I must've fucked up something pretty bad in the last update, I'll have to make sure I add more comprehensive unit tests and add a more general smoke testy sort of case in there.
@sankoshine
Alright, this should be fixed in v1.1.0. This actually fixes a bunch of corner cases too including images embedded in text like **text![]()text**
where previously it would just throw.
Going to close this as the fix has been applied. Thank you for the report and effort!
Image blocks were always giving "can't add image to inline context" error.
All image block are treated as
span tokens
and should be wrapped as children of a paragraph, which is ablock token
. So every timerender_image
is called, arender_paragraph
is following.