承接 mindtwo/laravel-markdown 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

mindtwo/laravel-markdown

最新稳定版本:1.0.1

Composer 安装命令:

composer require mindtwo/laravel-markdown

包简介

This is my package laravel-markdown

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

laravel-markdown is a simple, lightweight package for cleaning up and adjusting markdown content in Laravel applications. It provides functionality to remove bold formatting from markdown headlines and dynamically adjust the heading levels in markdown content based on a configurable maximum level. This is especially useful when rendering user-generated content and ensuring consistency in markdown formatting across your application.

Features

  • Remove Bold from Headlines: Automatically strip bold formatting (e.g., **Heading**) from markdown headings.
  • Adjust Headline Levels: Dynamically adjust markdown heading levels (e.g., # to ##, ## to ###, etc.) based on a configurable maximum level.

Installation

You can install the package via composer:

composer require mindtwo/laravel-markdown

Usage

To clean up your markdown content, you can use the CleanupMarkdown class, which handles both removing bold formatting from headlines and adjusting headline levels.

Example

use mindtwo\LaravelMarkdown\CleanupMarkdown;

$markdown = "# **Bold Heading**\n## **Bold Subheading**";
$cleanedMarkdown = (new CleanupMarkdown())->execute($markdown, 2);

echo $cleanedMarkdown;
// Outputs:
// ## Heading
// ### Subheading

In this example, the maximum headline level is set to 2, so all # headings are adjusted to ##, and bold formatting is removed from both headings.

Customization

You can specify the maximum headline level when calling the execute method. This determines how the headline levels will be adjusted:

$cleanedMarkdown = (new CleanupMarkdown())->execute($markdown, 3); // Max headline level is 3

Testing

To run the package's tests, use:

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Contributions are welcome! Please see CONTRIBUTING for details on how to contribute.

Security Vulnerabilities

If you discover any security-related issues, please review our security policy for how to report them.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-09-10