https://github.com/felixgirault/nokogiri
Cuts through XML like a breeze.
https://github.com/felixgirault/nokogiri
cut html php truncate-html xml
Last synced: about 1 year ago
JSON representation
Cuts through XML like a breeze.
- Host: GitHub
- URL: https://github.com/felixgirault/nokogiri
- Owner: felixgirault
- License: mit
- Created: 2015-02-05T23:43:52.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2024-04-09T13:13:56.000Z (about 2 years ago)
- Last Synced: 2025-04-10T01:12:58.268Z (about 1 year ago)
- Topics: cut, html, php, truncate-html, xml
- Language: PHP
- Homepage:
- Size: 26.4 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
Nokogiri
========
Cuts through XML like a breeze.
Examples
--------
Given this XML:
```xml
Lorem ipsum dolor sit amet.
```
Cutting it at the twentieth character...
```php
$Nokogiri = new Nokogiri\Nokogiri();
$Nokogiri->cut($xml, 20);
```
Would return:
```xml
Lorem ipsum dolor sit
```
Cutting it at the eleventh character...
```php
$Nokogiri->cut($xml, 11);
```
Would return:
```xml
Lorem ipsum
```
Note that the blank characters between tags are not taken into account.
Contributing
------
### Installation
Clone the project and run `composer install`.
### Running tests
Run tests with `composer run-script test`.
Notes
-----
The implementation is probably shitty, as I don't know anything about writing a
decent parser...
Also, the implementation of the parser itself is kind of tied to the class using
it. It is obviously bad but it works :grin: