Giter Club home page Giter Club logo

gotg_md2html's Introduction

gotg_md2html

Having played with telegram bots for a while, I've always hated how inconsistent the markdown support was. It has never seemed stable, consistent, or supported. Sending an "unterminated" entity would result in the message failing to send, even if it was an underscore in a url!

I have however had... better experiences with the HTML support, even if HTML5 symbols (such as ') aren't supported.

This is the reason for this project!

I wanted a way to reliably parse messages from basic markdown, to HTML, in a way that telegram would understand.

How to:

Simply use the MD2HTML function.

htmlText := tg_md2html.MD2HTML("_hello_ `there` *stranger*! I even support [links [with square brackets!]](github.com)")

I am also a fan of url buttons, so I added support for those too - using the following buttonurl: syntax:

htmlText, btnNames, btnLinks := tg_md2html.MD2HTMLButtons("_hello_ [this is a button](buttonurl:link.com)")

Simply prepending buttonurl: to any link will make the parser detect it as a button, and convert it appropriately. The function will return two new lists; button names and their respective links, mapped 1:1

gotg_md2html's People

Contributors

paulsonoflars avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.