imatic-it/imatic-formatting 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

imatic-it/imatic-formatting

最新稳定版本:v0.0.5

Composer 安装命令:

composer require imatic-it/imatic-formatting

包简介

README 文档

README

License: GPL-2.0-or-later

Imatic formatting

Purpose

Converts markdown into html.

Installation

composer config --unset platform.php
composer require imatic-it/imatic-formatting

Code highlighting

Following url was used to fetch code highlighting code: https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript+bash+clojure+markup-templating+php+sql

It can be disabled with:

$g_plugin_ImaticFormatting_include_prism = false;

ToastUI Editor (WYSIWYG)

This plugin integrates ToastUI Editor to provide a modern WYSIWYG and Markdown editor for text areas in MantisBT.

You can enable or configure the editor in your plugin config. Example:

public function config(): array
{
    return [
        'include_prism' => true,
        'toastui_editor' => [
            'enabled' => true,
            'textAreas'=> [
                'description',
                'additional_info',
                'additional_information',
                'bugnote_text'
            ],
            'options' => [
                'initialEditType' => 'markdown', // 'markdown' or 'wysiwyg'
                'previewStyle' => 'tab', // 'tab' or 'vertical'
                'height' => false, // Use false for default height
                'useDefaultHTMLSanitizer' => true,
                'useCommandShortcut' => true,
                'useDefaultHTMLSanitizerOptions' => [
                    'allowAttributes' => ['class', 'style'],
                    'allowTags' => ['a', 'b', 'i', 'strong', 'em', 'p', 'br', 'ul', 'ol', 'li', 'code', 'pre'],
                ],
            ],
        ]
    ];
}

Features

  • Markdown and WYSIWYG editing mode
  • Live preview (tab or vertical split)
  • Custom HTML sanitization with DOMPurify
  • Optional keyboard shortcuts
  • Automatic synchronization with MantisBT text areas

Preview Test Pages

The plugin provides test pages where you can see how your Markdown and HTML formatting will be rendered before using it in actual issues.

  1. Navigate to the Plugin Configuration Page: Manage -> Manage Plugins -> Imatic Formatting

  2. Click on "Test Issue Formatting Preview" or open directly: /plugin.php?page=ImaticFormatting/test-issue-previews.php

  3. You will find several preview sections:

    • 📧 HTML Rendered Preview – see how HTML emails will render
    • 📝 Plain Text Preview – view the plain text formatting
    • ⚠️ Broken Format Preview – simulate text without plugin formatting
    • 🔗 Link Rendering & Query Parameters – test links including query strings and & characters
    • 🖋️ Markdown Preview – test all Markdown elements including headings, lists, blockquotes, code blocks, tables, images, links, and horizontal rules

This is useful for verifying your formatting rules, link handling, WYSIWYG editor integration, and Markdown rendering be

统计信息

  • 总下载量: 594
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 2
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2020-08-17