voxpelli / node-format-microformat

Formats a Microformat JSON representation into eg. a Jekyll post
MIT License
13 stars 9 forks source link

Issue in Formatting blockquote character #8

Closed am1t closed 5 years ago

am1t commented 6 years ago

The markdown block quote character ">" gets formatted as ">". This causes further issues while generating a correct html.

To reproduce, try including ">" in content. The expected post formatted content should include ">" .

voxpelli commented 6 years ago

Can you provide some information about what type of request you are doing? An HTML-request should not be encoded while a text request should, so it could also be that the Micropub request is not correct.

am1t commented 6 years ago

It's a micropub request originating from micro.blog. I analysed the request, it looked fine to me. It had the ">" character. So I ran the test on formatAll with ">" in content and it still generated ">".

I did try to debug it a bit, but could not identify the core issue.

voxpelli commented 6 years ago

I'll try to look look into it @am1t – I've sent a question to @manton about it

voxpelli commented 6 years ago

Conclusion from Slack: Add an option that allows a user to opt out of HTML-encoding of text content – as Micro.blog right now sends Markdown as text and the > in Markdown otherwise gets encoded when one would want it to persist.

That's a non-standard behavior though, but a good convenience for now.

I'm not sure when I'll get time to do this though.

am1t commented 6 years ago

Sure. Thank you for looking into it. Till that happens, I guess I will have to find some workaround, especially for posts with blockquotes.

voxpelli commented 6 years ago

If you can submit a PR to this project (and maybe any needed modules that this one is using) then I’ll happily test it out and merge it

am1t commented 6 years ago

Sure, will do that.

am1t commented 6 years ago

I have submitted the pull request #18 to handle this. It have tested and validated with my deployment. It works fine for my need. I hope the changes closes this issue to your satisfaction.

herestomwiththeweather commented 6 years ago

i might be having a similar problem with micropub posts from alltogethernow to my jekyll site and hope to try this out.

am1t commented 6 years ago

Sure. It did resolve the issue for me. I do not think @voxpelli has got a chance to accept the pull yet. So you may have to select the branch appropriately.

herestomwiththeweather commented 6 years ago

oops. never mind. i did some testing and found out there was a problem on the micropub client i was using. it was not properly sending the html key in the content property as specified here: https://www.w3.org/TR/micropub/#h-new-article-with-html

voxpelli commented 5 years ago

Merged #18, so I'm closing this as done. Sorry for the delay @am1t!