You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gitea/web_src/js
silverwind dcde4701a5
Fix math and mermaid rendering bugs (#24049)
1. Fix multiple error display for math and mermaid:


![err](https://user-images.githubusercontent.com/115237/231126411-8a21a777-cd53-4b7e-ac67-5332623106e8.gif)

2. Fix height calculation of certain mermaid diagrams by reading the
iframe inner height from it's document instead of parsing it from SVG:

Before:
<img width="866" alt="Screenshot 2023-04-11 at 11 56 27"
src="https://user-images.githubusercontent.com/115237/231126480-b194e02b-ea8c-4ddf-8c79-50c525815d92.png">

After:
<img width="855" alt="Screenshot 2023-04-11 at 11 56 35"
src="https://user-images.githubusercontent.com/115237/231126494-5fe86a48-8d21-455a-8b95-79b6ee27a16f.png">

3. Refactor error handling to a common function
4. Rename to `renderAsciicast` for consistency
5. Improve mermaid loading sequence

Note: I did try `securityLevel: 'sandbox'` to make mermaid output a
iframe directly, but that showed a bug in mermaid where the iframe style
height was set incorrectly. Opened
https://github.com/mermaid-js/mermaid/issues/4289 for this.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
2 years ago
..
components Update the value of the `diffEnd` when click `Show More` btn in the DiffFileTree (#24069) 2 years ago
features Sort repo topic labels by name (#24123) 2 years ago
markup Fix math and mermaid rendering bugs (#24049) 2 years ago
modules Use 1.18's aria role for dropdown menus (#24144) 2 years ago
standalone Add new JS linter rules (#17699) 3 years ago
test Use link in UI which returned a relative url but not html_url which contains an absolute url (#21986) 2 years ago
utils Improve markdown editor: width, height, preferred (#23895) 2 years ago
webcomponents Refactor locale number (#24134) 2 years ago
bootstrap.js Show friendly 500 error page to users and developers (#24110) 2 years ago
index.js Use auto-updating, natively hoverable, localized time elements (#23988) 2 years ago
jquery.js Upgrade jQuery to 3.5.0, remove jQuery-Migrate, fix deprecations (#11055) 5 years ago
serviceworker.js Fix serviceworker output file and misc improvements (#11562) 5 years ago
svg.js Improve `<SvgIcon>` to make it output `svg` node and optimize performance (#23570) 2 years ago
svg.test.js Improve `<SvgIcon>` to make it output `svg` node and optimize performance (#23570) 2 years ago
utils.js Introduce GiteaLocaleNumber custom element to handle number localization on pages. (#23861) 2 years ago
utils.test.js Introduce GiteaLocaleNumber custom element to handle number localization on pages. (#23861) 2 years ago