Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/felixgirault/nokogiri
- Owner: felixgirault
- License: mit
- Created: 2015-02-05T23:43:52.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2024-04-09T13:13:56.000Z (9 months ago)
- Last Synced: 2024-11-30T09:39:26.365Z (about 1 month ago)
- Topics: cut, html, php, truncate-html, xml
- Language: PHP
- Homepage:
- Size: 26.4 KB
- Stars: 2
- Watchers: 3
- 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: