element-hq / element-web

A glossy Matrix collaboration client for the web.
https://element.io
GNU Affero General Public License v3.0
11.17k stars 1.99k forks source link

Ordered list clips numbers after 100 list items #28301

Closed SethFalco closed 3 days ago

SethFalco commented 5 days ago

Steps to reproduce

  1. Send or receive a message with an ordered list featuring over 100 items.

For example, the following Markdown:

A list of 202 movies/shows from IMDb. ```md 1. John Wick: Chapter 4 2. The Last of Us 3. The Menu 4. John Wick 5. John Wick: Chapter 3 - Parabellum 6. John Wick: Chapter 2 7. 65 8. Ant-Man and the Wasp: Quantumania 9. Stranger Things 10. Severance 11. Fringe 12. Superman and Lois 13. Black Panther: Wakanda Forever 14. Lost 15. Black Mirror 16. American Horror Story 17. The X Files 18. The Handmaid's Tale 19. Manifest 20. The Hunger Games: The Ballad of Songbirds & Snakes 21. From 22. The 100 23. Blade Runner 2049 24. Dark 25. The Peripheral 26. Jurassic World Dominion 27. 1899 28. The Matrix Resurrections 29. See 30. Shang-Chi and the Legend of the Ten Rings 31. Donnie Darko 32. Extraordinary 33. The OA 34. Heroes 35. A Quiet Place 36. Ant-Man 37. Aquaman and the Lost Kingdom 38. Knights of the Zodiac 39. Dark City 40. Blindspot 41. Idiocracy 42. Snowpiercer 43. Last Light 44. Blue Beetle 45. Arcadia 46. Morbius 47. Coherence 48. The Nevers 49. Man of Steel 50. Jurassic World 51. Invasion 52. A Quiet Place Part II 53. The Invisible Man 54. Sense8 55. Snowpiercer 56. Left Behind: Rise of the Antichrist 57. Ant-Man and the Wasp 58. Quantum Leap 59. Venom: Let There Be Carnage 60. Legion 61. Resident Evil: Welcome to Raccoon City 62. Travelers 63. Wifelike 64. A.I. Artificial Intelligence 65. Alias 66. The Giver 67. Superman 68. Level 16 69. 10 Cloverfield Lane 70. Escape Room 71. The Pretender 72. Daredevil: Born Again 73. Journey to the Center of the Earth 74. The Island 75. District 9 76. Vesper 77. Chronicle 78. The 5th Wave 79. What Happened to Monday 80. Equilibrium 81. The Darkest Minds 82. Brightburn 83. Love and Monsters 84. Superman Returns 85. Dark Angel 86. The Rain 87. Dark Matter 88. Geostorm 89. Triangle 90. Glitch 91. I Am Not Okay with This 92. The Witch: Part 1 - The Subversion 93. A Scanner Darkly 94. The Happening 95. Torchwood 96. Escape Room: Tournament of Champions 97. Into the Night 98. Between 99. Journey 2: The Mysterious Island 100. Roswell 101. Left Behind 102. Highlander 103. The Circle 104. Avatar: Fire and Ash 105. Fort Salem 106. V 107. The Signal 108. Brave New World 109. The Dead Zone 110. The Society 111. A Quiet Place: Day One 112. The Silence 113. Hidden 114. The Cloverfield Paradox 115. Dollhouse 116. The Gifted 117. Forever 118. 3% 119. Take Shelter 120. Next 121. Journey to the Centre of the Earth 122. Transcendence 123. Andromeda 124. Get Smart 125. Sanctuary 126. No Ordinary Family 127. Humans 128. Land of the Lost 129. Lifeforce 130. Limitless 131. The Girl with All the Gifts 132. Firestarter 133. I Am Mother 134. As the Gods Will 135. Simulant 136. Mouse 137. Land of the Lost 138. The Titan 139. Another Earth 140. Continuum 141. Morgan 142. Freaks 143. Heroes Reborn 144. Pulse 145. Disturbing Behavior 146. Primeval 147. Oxygen 148. Psycho-Pass 149. Kyle XY 150. The Handmaid's Tale 151. Paradise Hills 152. The First Purge 153. V 154. The 4400 155. Almost Human 156. The Backrooms 157. Millennium 158. Resident Evil: Infinite Darkness 159. Maggie 160. Ashes to Ashes 161. SurrealEstate 162. Black Mirror: Bandersnatch 163. Soldier 164. Serial Experiments Lain 165. The Listener 166. Mother/Android 167. The Tomorrow People 168. Relic Hunter 169. Tau 170. Control 171. Attack on Titan 172. The Thinning: New World Order 173. Bionic Woman 174. Impulse 175. Intelligence 176. Emergence 177. Cube 178. Criminal Minds 179. Supernatural 180. Scream 181. Knock at the Cabin 182. Smile 183. Prison Break 184. Sherlock 185. Charmed 186. Poirot 187. Hereditary 188. Spiral: From the Book of Saw 189. Scream: The TV Series 190. The Witch 191. Evil 192. Haunted Mansion 193. The Magicians 194. Midnight Mass 195. Orphan 196. Orphan: First Kill 197. Constantine 2 198. Run 199. MacGyver 200. Percy Jackson and the Olympians 201. Dungeons & Dragons: Honour Among Thieves 202. The Super Mario Bros. Movie ```

Outcome

What did you expect?

That the index shown to the left of each list item in the ordered list show it's number in full, including numbers over 100.

What happened instead?

After crossing to 3 digits, the ordered list no longer shows the full index anymore.

Entries 94 to 102:

Entries 194 to 202:

Operating system

Debian (Linux) and Tuxedo OS (Linux)

Application version

Element version: 1.11.81 Crypto version: Rust SDK 0.7.2 (7a21514), Vodozemac 0.7.0

How did you install the app?

https://element.io/get-started

Homeserver

one.ems.host

Will you send logs?

No


Investigation

A possible cause is that the library you use to render the Markdown does left-padding: 2em on ordered list, which is not enough space to hold 3 digits.

https://github.com/sindresorhus/github-markdown-css/blob/74e1bcc0522c478c3c83e04430784614795312a0/github-markdown-dark.css#L321

SethFalco commented 5 days ago

Closing as this issue comes from a dependency:

SethFalco commented 5 days ago

Reopened the issue as this behavior is expected upstream, and is expected to be worked around downstream. (So the fix should be implemented here.)

t3chguy commented 3 days ago

Duplicate of https://github.com/element-hq/element-web/issues/14621