UNPKG

marked-bidi

Version:
32 lines (26 loc) 1.05 kB
(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('marked')) : typeof define === 'function' && define.amd ? define(['marked'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.markedBidi = factory(global.marked)); })(this, (function (marked) { 'use strict'; function index() { return { useNewRenderer: true, renderer: { heading(...args) { const html = marked.marked.Renderer.prototype.heading.call(this, ...args); return html.replace(/^<(h\d)/, '<$1 dir="auto"'); }, list(...args) { const html = marked.marked.Renderer.prototype.list.call(this, ...args); return html.replace(/^<(ol|ul)/, '<$1 dir="auto"'); }, paragraph(...args) { const html = marked.marked.Renderer.prototype.paragraph.call(this, ...args); return html.replace(/^<p/, '<p dir="auto"'); }, }, }; } return index; }));