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
Match.content() returns owner tag name if content contains newlines #116
Comments
Awesome library! Saving me tons of time with manipulating XML. I'm now encountering this issue. Is there a workaround? Here's my exact use case: <Datum ID="Image-Collection" Type="DCR" Name="Image-Collection" Label="Select an image collection:" Changed="true">
<DCR Category="Site" Type="Image Collection">Site/Image Collection/data/awesome-images</DCR>
</Datum> $(doc).find("Datum").content(); // returns the full <Datum> tag running 1.3.0 |
I may have found the culprit but cannot fork to test due to limitations with my work environment. The regular expression may require the Pattern.DOTALL flag "(?s)". Can someone test? In Imp on line #~1454: private final String content(Element element)
return Util.toString(element).replaceAll("(?s)^<" + name + "(?:[^>]*)>(.*)</" + name + ">$", "$1"); |
A test to see if Pattern.DOTALL fixes issue jOOQ#116
Just created a pull request with the change. (fyi, this hasn't been tested) |
Short of being able to build and test, I tried this. |
THanks a lot for your feedback. Will have a look by tomorrow |
Spot on. Your suggestion fixes this issue. Thanks a lot for looking into this |
Woot! Thank you for being expeditious. I will test later today. |
I'm afraid that there is still a problem 😕. Although your unit test works, I'm getting strange results with my real-world doc. I'll try to provide you with an example but I'm required to cleanse the doc before posting it. stay tuned. |
The text was updated successfully, but these errors were encountered: