Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

PHP port of html5lib, currently unmaintained.

NotificationsYou must be signed in to change notification settings

html5lib/html5lib-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

html5lib - php flavourThis is an implementation of the tokenization and tree-building partsof the HTML5 specification in PHP.  Potential uses of this librarycan be found in web-scrapers and HTML filters.Warning: This is a pre-alpha release, and as such, certain parts ofthis code are not up-to-snuff (e.g. error reporting and performance).However, the code is very close to spec and passes 100% of testsnot related to parse errors.  Nevertheless, expect to have to updateyour code on the next upgrade.Usage notes:    <?php    require_once '/path/to/HTML5/Parser.php';    $dom = HTML5_Parser::parse('<html><body>...');    $nodelist = HTML5_Parser::parseFragment('<b>Boo</b><br>');    $nodelist = HTML5_Parser::parseFragment('<td>Bar</td>', 'table');Documentation:HTML5_Parser::parse($text)    $text  : HTML to parse    return : DOMDocument of parsed documentHTML5_Parser::parseFragment($text, $context)    $text    : HTML to parse    $context : String name of context element    return   : DOMDocument of parsed documentDeveloper notes:* To setup unit tests, you need to add a small stub file test-settings.php  that contains $simpletest_location = 'path/to/simpletest/'; This needs to  be version 1.1 (or, until that is released, SVN trunk) of SimpleTest.* We don't want to ultimately use PHP's DOM because it is not tolerant  of certain types of errors that HTML 5 allows (for example, an element  "foo@bar"). But the current implementation uses it, since it's easy.  Eventually, this html5lib implementation will get a version of SimpleTree;  and may possibly start using that by default.    vim: et sw=4 sts=4

About

PHP port of html5lib, currently unmaintained.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp