New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

mdx2bbcode

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mdx2bbcode

该项目用于扩展mcbbs论坛富文本编辑器,主要基于markdown的语法并扩展了论坛独有的语法功能,实现了快速书写的功能。

latest
Source
npmnpm
Version
0.1.2
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

Markdown to BBSCode

该项目用于扩展mcbbs论坛富文本编辑器,主要基于markdown的语法并扩展了论坛独有的语法功能,实现了快速书写的功能。

功能

  • markdown转bbcode
  • 主题配置
  • 双栏布局
  • 快速模板填充
  • 颜色拾色器
  • 代码片段
  • 代码折叠
  • 目录生成
  • 修复论坛若干bug

语法

插件是基于markdown语法扩展的,因此请先熟悉markdown语法的功能(包括GFM那部分的扩展),自行索引,这里就不提供了。插件扩展语法为本插件自行设计的,请务必认真阅读。

注意:这里扩展了link的语法,如果是media或audio开头的,会被转换成论坛对应的标签,例如 -> [audio]8945678[/audio]

1. 区域

使用region来声明一个作用域,支持嵌套和连续配置,支持的配置选项包括:

选项类型说明
freeboolean帖子免费信息
hideboolean隐藏信息
alignenum left|center|right文字排布方式
floatenum left|center|right文字浮动方式
boldboolean粗体,简写b
italicboolean斜体,简写i
underlineboolean下划线,简写u
strikethroughboolean删除线,简写s
colorstring文字颜色,支持十六进值和web颜色名称
backcolorstring背景颜色,支持十六进值和web颜色名称
fontstring字体
size1 | 2 | 3 | 4 | 5 | 6 | 7 | string字体大小
tablestring表格宽度
tablerowstring表格颜色
tablecellstring单元格宽度
inlineboolean设置当前区域为内敛块

2. 配置

使用 --- 来声明一个配置作用域,里面语法是yaml,可以配置多个,后面的会继承上一个配置,可以使用空配置重置配置

接口如下: FontStyle

字段类型说明
colorstring字体颜色
backcolorstring字体背景色
fontstring字体
boldboolean粗体
italicboolean斜体
underlineboolean下划线
strikethroughboolean删除线
inlineboolean文本内敛
alignleft|center|right文本排版方式
size1 | 2 | 3 | 4 | 5 | 6 | 7 | string字体大小

Config

字段类型说明
passwordstring帖子密码
postbgstring背景图片
h1FontStyle一级标题
h2FontStyle二级标题
h3FontStyle三级标题
h4FontStyle四级标题
h5FontStyle五级标题
h6FontStyle六级标题
textFontStyle正文
strongFontStyle粗体
emFontStyle斜体
delFontStyle删除线
paragraphFontStyle段落
linkFontStyle链接
listFontStyle列表
listitemFontStyle列表项
tablestring表格(宽度)
tablerowstring表格-行(颜色)
tablecellstring表格-单元格(宽度)

3. 目录

使用 === 来分页,后面可以声明目录的说明(不写默认目录x),例如:

===

=== 这里是目录xxx

修复论坛若干bug

  • 修复工具栏吸顶的问题
  • 修复引用块图片加载问题
  • 修复表格边框颜色和发布不一致的问题
  • 修复表格默认宽度100%和发布不一致的问题
  • 修复点击常用时部分按钮动画鬼畜的问题
  • 修复使用浮动布局和发布不一致的问题
  • 修复背景色和发布不一致的问题
  • 增强图片弹窗,点击数字复制文件标示

LICENSE

MIT

FAQs

Package last updated on 20 Aug 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts