wordpress-mobile / wordpress-mobile/WordPress-Android

Comments: LaTeX images are not rendered and an error displays

Open
#13,621 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

[Pri] Low [Type] Bug Comments
Dominant language
Kotlin
Stars
3.2k
Forks
1.4k
Avg merge
1d 11h
Merged PRs (30d)
69

Description

Ref. pbArwn-1v1-p2#comment-2201

Sister issue: https://github.com/wordpress-mobile/WordPress-iOS/issues/15483

Sample snippet of HTML from the Comment content field, on its own line:

\n<p>Bayes Rule says that:</p>\n<p><!-- /wp:paragraph --></p>\n<p><!-- wp:paragraph --></p>\n<p><img src=\"https://s0.wp.com/latex.php?latex=P%28Y%7CX%29+%3D+%5Cfrac%7BP%28X%7CY%29P%28Y%29%7D%7BP%28X%29%7D&#038;bg=ffffff&#038;fg=000&#038;s=0&#038;c=20201002\" alt=\"P(Y|X) = &#92;frac{P(X|Y)P(Y)}{P(X)}\" title=\"P(Y|X) = &#92;frac{P(X|Y)P(Y)}{P(X)}\" class=\"latex\" /></p>\n<p><!-- /wp:paragraph --></p>\n

Sample snippet of HTML from the Comment content field, inline LaTeX:

but here&#8217;s my understanding of the problem: you want to measure how a certain event (<img src=\"https://s0.wp.com/latex.php?latex=X&;bg=ffffff&;fg=000&;s=0&;c=20201002\" alt=\"X\" title=\"X\" class=\"latex\" />, e.g. replying to a comment) will influence an outcome (<img src=\"https://s0.wp.com/latex.php?latex=Y&#038;bg=ffffff&#038;fg=000&#038;s=0&#038;c=20201002\" alt=\"Y\" title=\"Y\" class=\"latex\" />, e.g. being active in November), which is the probability of Y happening given that you know X (<img src=\"https://s0.wp.com/latex.php?latex=P%28Y%7CX%29&#038;bg=ffffff&#038;fg=000&#038;s=0&#038;c=20201002\" alt=\"P(Y|X)\" title=\"P(Y|X)\" class=\"latex\" />). 
Expected behavior

When a user leaves a comment that uses LaTeX, the generated image(s) should display.

Actual behavior

When an image is generated from LaTeX, an error view appears in yellow and red stating "No formula provided".

Steps to reproduce
  1. Leave a comment with inline LaTex.
  2. Leave a comment that uses LaTeX on its own line.
  3. Navigate to Reader > Followed site > post > comments. There are no images rendered.
Tested on Pixel 2, Android 10, WPAndroid 16.3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue in Reader > Followed site > post > comments with both inline and standalone LaTeX snippets from the report. Trace the comment rendering and LaTeX image handling, then verify that both image forms render without the “No formula provided” error.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin, latex
Domain
mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.