Preview Plugin
-
@phenomlab hmm...
On the way in, you'd be hooking into
filter:post.create
, possibly. At that pointcontent
from an RSS feed would be html.I'll tell you how I'd approach it, which may be the wrong approach
npm i cheerio
- Parse incoming html and find all the anchors
- Do your preview generation
- Replace content using cheerio selectors.
Funny enough, this is exactly how
link-preview
works -
@julian said in Preview Plugin:
Funny enough, this is exactly how link-preview works
Yes,
OGProxy
works the same way My thoughts would be around a regex - something likenodebb-plugin-beep
but with the ability to completely remove words rather than just say "[censored]" - I could fork that plugin and write in that functionality actually...Hmmm....
-
@phenomlab I'm sure you've seen this?
RegEx match open tags except XHTML self-contained tags
I need to match all of these opening tags: <p> <a href="foo"> But not self-closing tags: <br /> <hr class="foo" /> I came up with this and wanted to make
Stack Overflow (stackoverflow.com)
Won't stop people like us from trying though hahaha
RegEx match open tags except XHTML self-contained tags
I need to match all of these opening tags: <p> <a href="foo"> But not self-closing tags: <br /> <hr class="foo" /> I came up with this and wanted to make
Stack Overflow (stackoverflow.com)
-
@julian Yes, thanks. Actually, I think I narrowed down the issue. There is a fork of
nodebb-plugin-rss
that I am using callednodebb-plugin-rss-brad
- I think the changes here are that it renders other HTML (description - like v1.3 of the official NodeBB version did), so I went for that.I think it is that plugin that adds "Via: " as it is doing it on all links, and not on my other site which uses the stock NodeBB version.
Let me confirm, and if so, this can be closed.
-
a github link in this post as:
GitHub - Licoy/wordpress-theme-puock: :art: 一款基于WordPress开发的高颜值的自适应主题,支持白天与黑夜模式/无刷新加载/第三方登录等众多功能 | A high-value adaptive theme based on WordPress, supports light and dark modes, no refresh loading, etc.
:art: 一款基于WordPress开发的高颜值的自适应主题,支持白天与黑夜模式/无刷新加载/第三方登录等众多功能 | A high-value adaptive theme based on WordPress, supports light and dark modes, no refresh loading, etc. - Licoy/wordpress-theme-puock
GitHub (github.com)
in my site :