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

Add an HTML crawler and translator #12

Merged
merged 6 commits into from
Mar 14, 2017
Merged

Conversation

loranmutafov
Copy link
Contributor

Enables translation of HTML tags or attributes via XPath expressions.

Q A
Type New feature

… text in HTML tags or attributes via XPath expressions
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling a64d45d on add-html-translator into fe8595e on master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 9ab2b79 on add-html-translator into fe8595e on master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 35a7b00 on add-html-translator into fe8595e on master.

{
$document = new DOMDocument();
$document->loadHTML(mb_convert_encoding(
sprintf('<div>%s</div>', $content),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps add a comment explaining why we add a div here?

*/
interface TranslatorInterface
{
const QUESTIONABLE_IGNORE = 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps add a description for what these constants do?

Argument::any(),
Argument::any(),
Argument::any()
)->willReturn('Translated'); // Keep in mind we ignore whitespace this way
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might make this test better to have it return the text passed in appended with 'Translated' rather than always 'Translated'

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 12267b8 on add-html-translator into fe8595e on master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling bfff619 on add-html-translator into fe8595e on master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 8b12728 on add-html-translator into fe8595e on master.

@rossmotley rossmotley merged commit 0786b64 into master Mar 14, 2017
@rossmotley rossmotley deleted the add-html-translator branch March 14, 2017 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants