ssbc/ssb-markdown

Name: ssb-markdown

Owner: Secure Scuttlebutt Consortium

Description: patchwork's markdown parser

Created: 2016-01-09 04:51:40.0

Updated: 2018-04-20 09:07:24.0

Pushed: 2018-04-20 09:07:23.0

Homepage: null

Size: 35

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

ssb-markdown

render patchwork/ssb messages to markdown.

patchwork has a few changes from standard markdown.

api
md = require('ssb-markdown')
md.block(source, { toUrl:, imageLink: })

Render raw markdown source to html. The output will be html content without a surrounding tag.

toUrl is a function which accepts an ssb-ref or @-mention string, and whether it is for an image or not, and returns a url string.

imageLink is a function which accepts an ssb-ref and will be used to generate links to wrap any images.

md.inline (source)

Render raw markdown to a single line of test, suitable for a one line preview that is opened to a view rendered with block.

License

MIT


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.