Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

² does not work #131

Closed
Suranex opened this issue Jul 26, 2017 · 1 comment
Closed

² does not work #131

Suranex opened this issue Jul 26, 2017 · 1 comment
Labels

Comments

@Suranex
Copy link

Suranex commented Jul 26, 2017

<?php
// Assuming you installed from Composer:
require "vendor/autoload.php";
use Masterminds\HTML5;

// An example HTML document:
$html = <<< 'HERE'
  <html>
  <head>
    <title>TEST</title>
  </head>
  <body id='foo'>
    <p>&sup2;</p>
  </body>
  </html>
HERE;

// Parse the document. $dom is a DOMDocument.
$html5 = new HTML5();
$dom = $html5->loadHTML($html);

// Render it as HTML5:
print $html5->saveHTML($dom);
?>

Expected Result is ², but its prints &³2;

I think, the problem is in https://github.com/Masterminds/html5-php/blob/2.x/src/HTML5/Parser/Tokenizer.php#L1074 where only AsciiAlpha are returned, but &sub2; needs the number. Therefore the call should be Scanner::getAsciiAlphaNum.

@goetas goetas added the bug label Jul 26, 2017
goetas added a commit that referenced this issue Jul 26, 2017
goetas added a commit that referenced this issue Jul 26, 2017
@goetas
Copy link
Member

goetas commented Jul 26, 2017

Fixed in #132
Thanks for the error report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants