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

Commite0b3824

Browse files
author
Edward Z. Yang ext:(%22)
committed
Don't lump whitespace and regular text together for data.
1 parentd50aff7 commite0b3824

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

‎library/HTML5/Tokenizer.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ class HTML5_Tokenizer {
8585
constLOWER_ALPHA ='abcdefghijklmnopqrstuvwxyz';
8686
constDIGIT ='0123456789';
8787
constHEX ='0123456789ABCDEFabcdef';
88+
constWHITESPACE ="\t\n\x0c";
8889

8990
/**
9091
* @param $data Data to parse
@@ -217,12 +218,17 @@ public function parse() {
217218
THIS IS AN OPTIMIZATION: Get as many character that
218219
otherwise would also be treated as a character token and emit it
219220
as a single character token. Stay in the data state. */
221+
$chars ='';
220222

221-
$mask ='->';
222-
if ($amp_cond)$mask .='&';
223-
if ($lt_cond)$mask .='<';
223+
// XSKETCHY: introduced three more fails (at least)
224+
if ($char !=='' &&$char !=="\n" &&$char !=="\r" &&
225+
$char !=="\t" &&$char !=="\x0c") {
226+
$mask ='->' .self::WHITESPACE;
227+
if ($amp_cond)$mask .='&';
228+
if ($lt_cond)$mask .='<';
224229

225-
$chars =$this->stream->charsUntil($mask);
230+
$chars =$this->stream->charsUntil($mask);
231+
}
226232

227233
$this->emitToken(array(
228234
'type' =>self::CHARACTER,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp