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

Added Unicode and emoji support #35

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

gjvnq
Copy link

@gjvnq gjvnq commented Mar 4, 2019

No description provided.

@coveralls
Copy link

coveralls commented Mar 4, 2019

Coverage Status

Coverage increased (+0.2%) to 75.816% when pulling 73e5f59 on gjvnq:master into c8489ed on antchfx:master.

@zhengchun
Copy link
Contributor

Hello, first thanks for your contribution, but your example //ul/li/@clášs日本語 is doesn't make sense. In mose cases, HTML, XML and JSON document supported english, number or under-line only. You should provides more example about why supports Unicode query. Thanks.

@gjvnq
Copy link
Author

gjvnq commented Mar 6, 2019 via email

@sosiska
Copy link

sosiska commented Apr 1, 2020

I need it to, because Federal Taxation Service of the Russian Federation uses Cyrillic characters in its xml files.


go 1.12

require github.com/antchfx/xpath v0.0.0-20190319080838-ce1d48779e67
Copy link
Contributor

Choose a reason for hiding this comment

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

Wait, why do you add go mod in this patch that has nothing to do with moving the library to go mod? Have we discussed about the module management strategy moving forward and agreed upon on this approach?

@@ -329,6 +330,7 @@ func (p *parser) parsePathExpr(n node) node {
}
} else {
opnd = p.parseLocationPath(nil)

Copy link
Contributor

Choose a reason for hiding this comment

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

Why add this empty line?

@@ -363,6 +365,7 @@ func (p *parser) parseLocationPath(n node) (opnd node) {
p.next()
opnd = newRootNode("//")
opnd = p.parseRelativeLocationPath(newAxisNode("descendant-or-self", "", "", "", opnd))

Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

if err != nil {
t.Fatalf("//ul/li/@clášs日本語 should be correct but got error %s", err)
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

While this does seem to cover the additions you made in scanner/parse.go code, it would be nice to actually have a test/tests to show the compiled utf8 friendly expr that actually works on an actual html/xml, i.e. select works.

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.

5 participants