synzen / MonitoRSS

MonitoRSS RSS bot (formerly known as Discord.RSS) with customizable feeds. https://monitorss.xyz
https://monitorss.xyz
MIT License
1.05k stars 237 forks source link

html to markdown issues #364

Closed m417z closed 5 months ago

m417z commented 7 months ago

Describe the bug

This issue is related to my previous issues regarding html to markdown: https://github.com/synzen/MonitoRSS/issues/343, https://github.com/synzen/MonitoRSS/issues/356

I have a feed with a post similar to the following:

<p>test1 <strong>test2</strong> test3 <code>test4</code>.</p>

I got the following markdown in the Discord publication:

test1
**test2**test3
`test4`
.

Notice the newlines and the lack of space after test2. Expexted:

test1 **test2** test3 `test4`.

To Reproduce

Steps to reproduce the behavior:

  1. Publish a post with the feed containing the html above

Expected behavior

See above.

Screenshots

If applicable, add screenshots to help explain your problem.

Branch (please specify one):

public bot

Additional context

Add any other context about the problem here.

m417z commented 6 months ago

I also noticed that a simple link isn't handled, even though it's supported by Discord's markdown. For example:

text <a href="https://example.com/">link</a> more text

Just turns into:

text link more text

Instead of:

text [link](https://example.com/) more text
synzen commented 6 months ago

Apologies for the delay here

  1. As for the first issue you've posted, I've not yet had time to tackle a solution for this - it seems like there may be some complexity involved. I'll update this issue once there's another update
  2. This is interesting - it's currently this way because Discord only supported masked links within certain fields of embeds, and not anywhere else. It looks support has been added now within the message content itself. I believe the best way forward to add support for this (without potentially breaking existing feeds) is to explicitly add another config in the control panel (that would be toggled on by default for newly added feeds) to opt into masked links. I'll update this issue once it's been added as well
synzen commented 5 months ago

This should all be addressed now in https://github.com/synzen/MonitoRSS/commit/1cac5aa679276aedb795f05c57aa4ee20fce2691, https://github.com/synzen/MonitoRSS/commit/e6f081d357ea4864a799d8a96a203a5195064fa0, https://github.com/synzen/MonitoRSS/commit/2d862c88c1ace698429bf344caadeff170a22afc, https://github.com/synzen/MonitoRSS/commit/86b2a611b8c83239a5ff96db5b32f746a4c50650