node-red / flow-library

Node-RED Flow Library
Apache License 2.0
70 stars 44 forks source link

https://flows.nodered.org/ doesn't correctly format node readme page #29

Open rsenden opened 5 years ago

rsenden commented 5 years ago

It looks like flows.nodered.org is handling Markdown formatting differently than GitHub and npmjs.com. For example, the readme file for https://github.com/rsenden/node-red-contrib-map is displayed correctly on both GitHub and on https://www.npmjs.com/package/node-red-contrib-map, but parts of the list entries are incorrectly displayed as code blocks on https://flows.nodered.org/node/node-red-contrib-map.

I guess this may be due to leading spaces within those list entries. I could easily fix this in a new version of the plugin, however it would make more sense if flows.nodered.org would handle the Markdown formatting the same as GitHub and npmjs.com.

knolleary commented 5 years ago

@rsenden the flow library repository is here: https://github.com/node-red/flow-library. This is the repository for the main website. I will transfer this issue over to that repository.

edited my comment - I misread this to be related to image handling - which is where I was talking about edge cases due to the way npm/github remap urls for where they host images in your repo.

We use the marked library - https://www.npmjs.com/package/marked - for markdown parsing and rendering. If there is a better library or one that is closer to what github and npm uses, then we could consider it. But the main point being, we don't do the parsing ourselves, so unless there's a simple switch out of a library, then it's unlikely we can do much.

rsenden commented 5 years ago

I think most Markdown implementations consider text that's indented with a certain number of spaces as code blocks, but most implementations require an empty line before and after the code block. Apparently marked considers any indented text as a code block independent of whether it is preceded by an empty line, thereby causing the formatting issue with my readme.

We could consider filing an issue with marked, but in the short term I guess it's easier to update my readme file.