项目作者: thipages

项目描述 :
Text formatter
高级语言: JavaScript
项目地址: git://github.com/thipages/text2html.git
创建时间: 2020-01-02T15:00:05Z
项目社区:https://github.com/thipages/text2html

开源协议:MIT License

下载


text2html

Text to HTML formatter and more …

Basic usage

  1. const format = {
  2. blue:{tag:'span',style:'color:blue;'}
  3. }
  4. // returns I am <span style="color:blue;">stuck</span>
  5. text2html(format)("I am \\blue{stuck}").output;

Features

# pattern Feature
1 \key{text} wraps text
2 \key\ wraps content (start)
3 \\ wraps content (end)
4 \key/ adds content
5 \_key[:type] delimiters content*

* not yet implemented

Rules

  • Empty lines are removed
  • Pattern #1 can be inline, all others are on a separate line
  • span is the default tag
  • ul key/tag wraps new lines content