ppy / osu-framework

A game framework written with osu! in mind.
MIT License
1.64k stars 409 forks source link

`MarkdownFencedCodeBlock` has extra empty line at the end #4482

Closed gagahpangeran closed 9 months ago

gagahpangeran commented 3 years ago

As seen in current markdown test scene, with this text

```scriban-html

[Escape me]
[[Escape me]]

{{
  x = ""5""   # This assignment will not output anything
  x         # This expression will print 5
  x + 1     # This expression will print 6
}}

the `MarkdownFencedCodeBlock` will render this

![Screenshot from 2021-06-02 18-33-02](https://user-images.githubusercontent.com/4964985/120474775-cde7c880-c3d2-11eb-885a-d8ecd12ee083.png)

Another simple test case is
test


![Screenshot from 2021-06-02 18-35-02](https://user-images.githubusercontent.com/4964985/120474872-e821a680-c3d2-11eb-810f-25dd5f3e07fc.png)

Further investigation, the cause is `FencedCodeBlock` from Markdig produce extra empty string line, so the component renders empty newline.

![Screenshot from 2021-06-02 18-41-39](https://user-images.githubusercontent.com/4964985/120474979-038cb180-c3d3-11eb-9af7-fd61c36b6fcc.png)

![Screenshot from 2021-06-02 18-35-25](https://user-images.githubusercontent.com/4964985/120475160-359e1380-c3d3-11eb-978b-c7c7d301099d.png)

Not sure this should be fix in our end or report it to upstream.
Stedoss commented 9 months ago

This has been resolved locally in #5620.

Susko3 commented 9 months ago

👍

Current master:

image