定制 vikpe/php-html-heading-normalizer 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

vikpe/php-html-heading-normalizer

最新稳定版本:1.1.0

Composer 安装命令:

composer require vikpe/php-html-heading-normalizer

包简介

PHP class for normalizing (promote/demote) HTML headings

README 文档

README

PHP class for normalizing (promote/demote) HTML headings.

Build Status Test Coverage Code Climate Scrutinizer Code Quality StyleCI

Installation

composer require vikpe/php-html-heading-normalizer

Methods

promote(string $html, int $numberOfLevels)

Promotes all headings in $html by $numberOfLevels levels.

\Vikpe\HtmlHeadingNormalizer::promote('<h6>Foo</h6>', 3); // '<h3>Foo</h3>'

demote(string $html, int $numberOfLevels)

Demotes all headings in $html by $numberOfLevels levels.

\Vikpe\HtmlHeadingNormalizer::demote('<h1>Foo</h1>', 1); // '<h2>Foo</h2>'

min(string $html, int $minLevel)

Promotes/demotes all headings in $html so that the lowest heading level equals $minLevel.

\Vikpe\HtmlHeadingNormalizer::min('<h4>Foo</h4><h5>Bar</h5>', 1); // '<h1>Foo</h1><h2>Bar</h2>'

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-12-22