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

Content outside of CDATA is lost #140

Open
ToasterKTN opened this issue Mar 13, 2020 · 0 comments
Open

Content outside of CDATA is lost #140

ToasterKTN opened this issue Mar 13, 2020 · 0 comments

Comments

@ToasterKTN
Copy link

Expected behavior

As in parseutil described:
// content outside of CDATA tags is passed via DecodeEntities

Actual behavior

Only content within CDATA is returned

Steps to reproduce the behavior

Add some text before or after CDATA Tags

QuickFix

As for now, i changed line 45 to

	if strings.Contains(result, CDATA_START) {
		prestring, _ := DecodeEntities(result[:strings.Index(result, CDATA_START)])
		cdatastring := StripCDATA(result)
		poststring, _ := DecodeEntities(result[strings.Index(result, CDATA_END)+len(CDATA_START):])
		return prestring + cdatastring + poststring, nil
	}

Because i did not quickly get the logic of StripCDATA.

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

No branches or pull requests

1 participant