Skip to content

Conversation

LucunJi
Copy link
Contributor

@LucunJi LucunJi commented Jul 22, 2025

  • render Markdown to HTML, including Markdowns in content and embeds
    • the title extracted from content is also rendered
    • add dependencies: discord-markdown-parser, @khanacademy/simple-markdown
  • improve template with
    • better spacing,
    • rendered embed fields,
    • spoiler for attachments with SPOILER_ prefix.
  • misc including
    • using embed title as message title, if there is no content,
  • list is not parsed cuz it's not supported in discord-markdown-parser, I may add support for it in the future
  • not rigorously tested as this is not generally reviewed
  • Need help: how do I get correct timezone for parsing timestamp without using user's IP?

Involved Issue / 该 PR 相关 Issue

N/A

Example for the Proposed Route(s) / 路由地址示例

(it should fail without proper DISCORD_AUTHORIZATION)

/discord/channel/0

New RSS Route Checklist / 新 RSS 路由检查表

  • New Route / 新的路由
  • Anti-bot or rate limit / 反爬/频率限制
    • If yes, do your code reflect this sign? / 如果有, 是否有对应的措施?
  • Date and time / 日期和时间
    • Parsed / 可以解析
    • Correct time zone / 时区正确
  • New package added / 添加了新的包
  • Puppeteer

Note / 说明

- render Markdown to HTML, including Markdowns in content and embeds
  - the title extracted from content is also rendered
  - add dependencies: discord-markdown-parser, @khanacademy/simple-markdown
- improve template with
  - better spacing,
  - rendered embed fields,
  - spoiler for attachments with SPOILER_ prefix.
- misc including
  - using embed title as message title, if there is no content,
- list is not parsed cuz it's not supported in discord-markdown-parser, I may add support for it in the future
- not rigorously tested as this is not generally reviewed
@github-actions github-actions bot added dependencies This PR involves changes to dependencies route auto: DO NOT merge labels Jul 22, 2025
Copy link
Contributor

Successfully generated as following:

http://localhost:1200/discord/channel/0 - Failed ❌
HTTPError: Response code 503 (Service Unavailable)

Error Message:<br/>ConfigNotFoundError: Discord RSS is disabled due to the lack of &lt;a href=&quot;https://docs.rsshub.app/deploy/config#route-specific-configurations&quot;&gt;relevant config&lt;/a&gt;
Route: /discord/channel/:channelId
Full Route: /discord/channel/0
Node Version: v22.17.1
Git Hash: 8267ce77

Copy link
Contributor

Successfully generated as following:

http://localhost:1200/discord/channel/0 - Failed ❌
HTTPError: Response code 503 (Service Unavailable)

Error Message:<br/>ConfigNotFoundError: Discord RSS is disabled due to the lack of &lt;a href=&quot;https://docs.rsshub.app/deploy/config#route-specific-configurations&quot;&gt;relevant config&lt;/a&gt;
Route: /discord/channel/:channelId
Full Route: /discord/channel/0
Node Version: v22.17.1
Git Hash: 6fff21ce

.join(' / ');
}

title = mdFormatter.parse(title);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may causes the title to include HTML. title is expected to have plain text only.

Copy link
Contributor

Successfully generated as following:

http://localhost:1200/discord/channel/0 - Failed ❌
HTTPError: Response code 503 (Service Unavailable)

Error Message:<br/>ConfigNotFoundError: Discord RSS is disabled due to the lack of &lt;a href=&quot;https://docs.rsshub.app/deploy/config#route-specific-configurations&quot;&gt;relevant config&lt;/a&gt;
Route: /discord/channel/:channelId
Full Route: /discord/channel/0
Node Version: v22.17.1
Git Hash: cae858a5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants