Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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 month ago
JSON representation

Cuts through XML like a breeze.

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: