goldmark-tgmd โœจ

May 22, 2025 ยท View on GitHub

MadPixels

goldmark-tgmd โœจ

License: MIT Go

goldmark-tgmd is an extension for the goldmark Markdown parser that adds support for Telegram-specific Markdown features ๐Ÿš€. This library allows developers to render Markdown text according to Telegram's formatting options, making it easier to create content for bots ๐Ÿค– and applications integrated with Telegram ๐Ÿ“ฑ.

Features ๐ŸŒŸ

  • Support for Telegram Markdown features including custom entities like hidden text and strikethrough text. ๐Ÿ“
  • Easy integration with goldmark-based projects. ๐Ÿ”Œ
  • Extensible architecture for further customizations. ๐Ÿ”จ

Getting Started ๐Ÿš€

Prerequisites ๐Ÿ“‹

  • Go 1.19 or higher

Installation ๐Ÿ’ฝ

To install goldmark-tgmd, use the following go get command:

go get github.com/Mad-Pixels/goldmark-tgmd

Usage ๐Ÿ› ๏ธ

package main

import (
   "bytes"
   "fmt"
   "os"
   
   tgmd "github.com/Mad-Pixels/goldmark-tgmd"
)

func main() {
   var buf bytes.Buffer
   content, _ := os.ReadFile("./examples/source.md")
   
   md := tgmd.TGMD()
   _ = md.Convert(content, &buf)
   fmt.Println(buf.String())
}

You can try example

Contributing

We're open to any new ideas and contributions. We also have some rules and taboos here, so please read this page and our Code of Conduct carefully.

I want to report an issue

If you've found an issue and want to report it, please check our Issues page.