Both Mixed-HTML-Fix & Image-Proxy are plugins for Markdown-It, focusing on easy rendering Steem related content (but still good for general usage)
@blocker/markdown-it-mixed-html-fixThis package is a simple parsing fix to allow mixed HTML to live well with Markdown links and images.
For example:
<some-tag>foo-bar</some-tag>

This syntax, while used by many authors is currently rendering the links as plain text, unless this fixer-plugin is used.
Related discussions about this: https://github.com/busyorg/busy/issues/1647
Thank you for pointing me the problem.
const MarkdownIt = require('markdown-it')
const htmlFix = require('@blocker/markdown-it-mixed-html-fix')
const md = new MarkdownIt()
md.use(htmlFix)
@blocker/markdown-it-image-proxySimple, but powerful plugin for parsing images with a prefix / proxy URL, just like Steemit & Busy uses https://steemitimages.com/0x0.
const MarkdownIt = require('markdown-it')
const imageProxy = require('@blocker/markdown-it-image-proxy')
const md = new MarkdownIt()
md.use(imageProxy, {
// default proxy URL prefix.
proxy: 'https://steemitimages.com/0x0/',
// bypass for images on the following domains (defaults to none).
trusted: [
'https://i.imgur.com',
'https://image.ibb.co'
]
})
This will be enough to parse all image tags with the steemitimages.com prefix.
Notice, that while prefixing image URL's, it will bypass the prefixing for the trusted origins.
Minimalist Javascript, built with Rollup.
Those are the first installments of a series of plugins for Markdown-It, I mean to cover all Steem related parsing and sanitization as possible and bundle on a single parser package later.
Github issues, comment or contact on Discord (@hernandev#5834)