Fix bug when getting HTML or text content of a note #33
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.