go-emoji

Golang Emoji parser, converter to html and images

  • 所有者: urakozz/go-emoji
  • 平台:
  • 許可證: MIT License
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

go-emoji

Build Status

Golang Emoji parser, converter to html and images

Usage

Parse

parser := NewEmojiParser()
var text = "a #? #and #? #?"
var i = -1
replased := parser.ReplaceAllStringFunc(text, func(s string) string {
	i++
	return strconv.Itoa(i)
})
// replased == "a #0 #and #1 #2"

Convert

To HTML-Entities

parser := NewEmojiParser()
text := "a #? #and #? #?"
replased := parser.ToHtmlEntities(text)
// replased == "a #💩 #and #🍦 #😳"

To HTML-Images

parser := NewEmojiParser()
text := "a #? #and #? #?"
replased := parser.ToHtmlImages(text)

result:

a #<img
class="emoji"
draggable="false"
alt="?"
src="https://twemoji.maxcdn.com/36x36/1f4a9.png"> #and #<img
class="emoji"
draggable="false"
alt="?"
src="https://twemoji.maxcdn.com/36x36/1f366.png"> #<img
class="emoji"
draggable="false"
alt="?"
src="https://twemoji.maxcdn.com/36x36/1f633.png">

References

  1. Instagram developers blog
  2. Twemoji SVG https://github.com/twitter/twemoji
  3. Unicode Emojii data emoji-data.txt
  4. Unicode Tech Report 51 tech report
  5. Contributors of the same library for the PHP https://github.com/urakozz/php-emoji-regex/pulls?q=is%3Apr+is%3Aclosed

主要指標

概覽
名稱與所有者urakozz/go-emoji
主編程語言Go
編程語言Go (語言數: 1)
平台
許可證MIT License
所有者活动
創建於2015-10-20 14:32:39
推送於2020-01-27 10:31:11
最后一次提交2020-01-27 11:31:10
發布數0
用户参与
星數42
關注者數3
派生數14
提交數12
已啟用問題?
問題數2
打開的問題數2
拉請求數0
打開的拉請求數0
關閉的拉請求數0
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?