Issue with "<" character in HTML Notifications not escaped
Describe the bug
It appears the < character is not escaped in HTML notifications. The < character does not show and causes problems after it.
Version v0.48.05
How did you install?
Docker
To Reproduce
Steps to reproduce the behavior:
- Set notification to HTMLcolor and set an email notification
- Set notification body to {{diff_full}}
- changes on https://changedetection.io/CHANGELOG.txt do not show the < character and truncate after it.
on the notification:
0.47.00 The line "Visual Selector - Including <button> (#2686)" becomes - "Visual Selector - Including (#2686)"
0.46.00 The notification is truncated after - UI - Extract it cannot cope with <title> No further lines are included in the notification.
Expected behavior The notification body should show the whole {{diff_full}}
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information): Email application: Outlook Email account: gmail
wow thanks for this, can you test if its the same with HTML format and HTML color format?
Hi I have just tested with HTML as requested. The result is the same.
Looking at the HTML source of the notification email, in the example given, the whole of CHANGELOG.txt is contained in the email, but Outlook renders the code. Copy/pasting the HTML from the notification email into chrome/firefox highlights the problem.
This may only be a problem where the web page contains a .txt file and {{diff_full}} converts to HTML?
I have further tested Markdown format with the same result.
Where the web page is a .txt file, it appears that only Text format notifications display correctly in the notification email.
Ok hmm
I have further tested Markdown format with the same result.
I'm not sure what todo about the markdown format, whats the expectation here, that cdio will convert the markdown to HTML, and then send the diff?
I'm not sure what todo about the
markdownformat, whats the expectation here, that cdio will convert the markdown to HTML, and then send the diff?
Many thanks for the work done on HTML format notifications. I don't really have any expectations regarding Markdown format, I am not using it at all, and the issue has not come up before.
It was only the change to HTML Color which is perfect for my needs (and now the default format) that was causing real life problems.
hmmm but this would break the situation where someone has HTML in their notification body
for example they have some custom HTML
{{diff_full}}..
I don't know if this helps. but I think the problem only occurs when the watch page is a .txt file, such as https://changedetection.io/CHANGELOG.txt
Rather than escape all the html in the whole notification, can you just escape the characters needed within the portion of the notification that is the actually the .txt file?
fixed