Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/itorr/weibo-face

🧣「解析微博表情」微博表情解析替换
https://github.com/itorr/weibo-face

face javascript npm weibo

Last synced: 22 days ago
JSON representation

🧣「解析微博表情」微博表情解析替换

Awesome Lists containing this project

README

        

# 解析微博表情

## 安装
```bash
npm i weibo-face
```
或者
### 引用 CDN
例 [html/npm-cdn.html](https://lab.magiconch.com/weibo-face/npm-cdn.html)
[源代码](https://github.com/itorr/weibo-face/blob/main/html/npm-cdn.html#L46)

## 使用

### 转换正文中表情成网页代码
```javascript
import { weiboFaceParse } from 'weibo-face'

weiboFaceParse('好耶[太开心][鼓掌][嘻嘻]')
// '好耶太开心鼓掌嘻嘻'
```

### 获取表情列表
```javascript
import { WeiboFaceByValues } from 'weibo-face'
// { value: url,... }

Object.entries(WeiboFaceByValues)
// [ [value, url],... ]
```
## 建议的样式
```CSS
.weibo-face{
width: 18px;
height: 18px;
vertical-align: -4px;
margin: 0 1px;
}
```