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

Fix bug when getting HTML or text content of a note #33

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ToomasT
Copy link

@ToomasT ToomasT commented Oct 16, 2017

When you read the HtmlContent or TextContent property of ENNote or ENNoteAdvanced then it is sometimes cut shorter than it should be, sometimes very short. This happens if the note contains any resources such as images (en-media tags in ENML), which are inline so that more text follows an image and there might be another image embedded in the content and so on. The current implementation returns the text up to the first image and cuts out the rest. Actually, what content gets left out depends exactly where the images are and if there are any BR tags and so on, but that's the gist of it.
Technical implementation details:
It seems the root cause of this bug is the fact that there is not one way to close the en-media tag, which is <en-media ... />, but two ways - there is also <en-media ...></en-media> and the current implementation only deals with the first case. The commit within this pull request deals with both cases.

@ToomasT
Copy link
Author

ToomasT commented Oct 16, 2017

Here is some test data, if you like.
TestData.txt

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.

1 participant