https://github.com/manufosela/rich-markdown-to-html
Library to convert Rich Mark Down (color and background images) into HTML code
https://github.com/manufosela/rich-markdown-to-html
Last synced: about 2 months ago
JSON representation
Library to convert Rich Mark Down (color and background images) into HTML code
- Host: GitHub
- URL: https://github.com/manufosela/rich-markdown-to-html
- Owner: manufosela
- License: apache-2.0
- Created: 2021-06-16T13:41:04.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-06-16T13:43:47.000Z (over 4 years ago)
- Last Synced: 2025-07-07T06:44:11.605Z (6 months ago)
- Language: JavaScript
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Rich MarkDown To HTML
Use heading titles, strong, italic and strong-italic text to add color
## Conventions from Rich MarkDown
```
# Heading level 1 ->
Heading level 1
# |#F93|Heading level 1 -> Heading level 1
## Heading level 2 -> Heading level 2
## |#F93|Heading level 2 -> Heading level 2
### Heading level 3 -> Heading level 3
### |#F93|Heading level 3 -> Heading level 3
#### Heading level 4 -> Heading level 4
#### |#F93|Heading level 4 -> Heading level 4
**strong text** -> strong text
**|2BD|strong text** -> strong text
**|_/img/linea.png_|texto negrita* -> texto negrita
**|2BD||_/img/linea.png_|img negrita** -> texto negrita
*italic text* -> italic text
*|3FA|italic text* -> italic text
***strong and italic text*** -> strong text
***|green|strong and italic text*** -> strong text
··texto subrayado·· -> texto subrayado
··|_/img/linea.png_| texto subrayado·· -> texto subrayado
```
## Regular expressions:
### Headings
```
^#\s(.*)
^##\s(.*)
^###\s(.*)
^####\s(.*)
^#####\s(.*)
^######\s(.*)
```
### italica *
```
[^*]\*([^\*].*?)\*
```
### Negrita **
```
[^*]\*\*([^\*].*?)\*\*
```
### negrita e italica ***
```
[^*]\*\*\*(.*?)\*\*\*
```
### subrayado ··
```
[^·]··(.*?)··
```
### color |...|
```
\|([\(\)\w#]*)\|(.*)
```
### imagen |_..._|
```
\|_([\/\w\.]*)_\|(.*?)
```
## DEMO
```
import pkg from 'rich-markdown-to-html';
const { parseRMD} = pkg;
const result = parseRMD(`
**|orange|hola** pepito lopez
*Cómo estás*
***negrita y cursiva***
# |rgba(255, 255, 0, 0.5)|titulo 1
## titulo 2
### titulo 3
#### titulo 4
##### |blue|titulo 5
###### titulo 6
**|2BD||_/img/linea.png_|img negrita**
otro texto sin importancia pero esta ··palabra·· va **|_https://png.pngtree.com/element_our/20200609/ourmid/pngtree-purple-underline-image_2231184.jpg_|subrayada**
No se que mas poner
`);
console.log(result);
```