Folo icon indicating copy to clipboard operation
Folo copied to clipboard

Renderer cannot process latex fraction

Open mark9804 opened this issue 10 months ago • 3 comments

Describe the bug

Example:

The equation goes as

\text{Attention}(Q, K, V) = \text{softmax}\left(\frac{QK^\top}{\sqrt{d}}\right)V

and is logged correctly in rss feed file.

Image

However, the same equation is rendered in Follw as below:

Image

Feed Info

Feed ID: 120051929158546432

Reproduction Video

No response

Environment

Environment

App Version: 0.3.8 OS: macOS User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Follow/0.3.8 Chrome/132.0.6834.196 Electron/34.2.0 Safari/537.36 Env: electron Browser: Chrome Session Trace Id: TLQXyWHPUY3yN8ndE0o9j Renderer: 0.3.8

Validations

  • [x] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • [x] Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • [x] This issue is valid

Contributions

  • [x] I am willing to submit a PR to fix this issue
  • [x] I am willing to submit a PR with failing tests (actually just go ahead and do it, thanks!)

mark9804 avatar Mar 05 '25 14:03 mark9804

You should process them with KaTeX or MathJaX and transform the TeX code into HTML structure manually in your pre-procession.

PrinOrange avatar Mar 13 '25 08:03 PrinOrange

Since Follow already added support for latex in https://github.com/RSSNext/Follow/commit/ef8939868986cbbdc3f00cc865b3b435a611b936 , I think it might be better to implement fraction support on Follow's side rather than RSS generators', as you cannot force all site owners to transform TeX code manually into HTML.

mark9804 avatar Mar 13 '25 16:03 mark9804

I think the RSS specification requires the content to be HTML

hyoban avatar Apr 14 '25 03:04 hyoban