rtl-md

A simple markdown to html converter which knows the direction!

MIT License

Downloads
5
Stars
28
Committers
1

rtl-md

rtl-md is a markdown parser with RTL languages detection. This module converts the Markdown to HTML and fixes the elements direction based on the contents of them. This module made in order to help users publish their RTL markdown contents easily, without having to write boring HTML. Now, I can write and publish my README.md files in RTL languages too just like LTR languages!

Installation

npm install --save rtl-md

Usage

import rmd from 'rtl-md';
const md = `# Some Markdown!
## Some english ltr stuff here and then, some rtl maybe.

   

     

[ ](https://en.wikiquote.org/wiki/Saadi)
`
const html = rmd(md);

// The output
/*
<h1 id="some-markdown-">Some Markdown!</h1>
<h2 id="some-english-ltr-stuff-here-and-then-some-rtl-maybe-">Some english ltr stuff here and then, some rtl maybe.</h2>
<p dir="rtl">   </p>
<p dir="rtl">     </p>
<p dir="rtl"><a href="https://en.wikiquote.org/wiki/Saadi"> </a></p>
*/

Ideas || Issues

Just fill an issue and describe it. I'll check it ASAP!

Contribution

You can fork the repository, improve or fix some part of it and then send the pull requests back if you want to see them here. I really appreciate that. ❤️

Remember to lint your code before sending pull requests. Run the Grunt lint task with the following command and fix the lint errors if you get any.

grunt lint