1
1
mirror of https://github.com/go-gitea/gitea synced 2024-11-12 13:14:24 +00:00
gitea/modules/markup/markdown
Yarden Shoham b5c418f271
Don't use <br /> in alert block (#29650)
- Follows https://github.com/go-gitea/gitea/pull/29121

When I implemented alert blocks I was always testing the markdown in
issue comments. I used `<br />` for line breaks and it looked good. I
have since learned that the markdown on README files doesn't allow these
tags. So a comment with

```md
> [!NOTE]
> If you're interested in using our APIs, we have experimental support with [documentation](https://try.gitea.io/api/swagger).
```

looked like this in a comment

![image](https://github.com/go-gitea/gitea/assets/20454870/96b1de01-2c87-4d4f-83dd-98192b83e9d0)
but looked like this in a README

![image](https://github.com/go-gitea/gitea/assets/20454870/474b636d-dd7a-4b7f-ba27-643803c71aa3)

So I changed how we render the alert block by having the alert itself
have a dedicated paragraph, so line breaks happen naturally between
paragraphs.

# Before

![image](https://github.com/go-gitea/gitea/assets/20454870/474b636d-dd7a-4b7f-ba27-643803c71aa3)

![image](https://github.com/go-gitea/gitea/assets/20454870/167a8d37-9a44-4479-9340-5dc80347b595)

# After

![image](https://github.com/go-gitea/gitea/assets/20454870/2f99fec0-98ff-4ba8-97fe-b4567041ae79)

![image](https://github.com/go-gitea/gitea/assets/20454870/ffdeae11-fb06-4d00-b497-eae135f0d7ad)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
2024-03-08 09:30:41 +00:00
..
math Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
ast.go Add alert blocks in markdown (#29121) 2024-02-10 18:43:09 +00:00
convertyaml.go Improve Wiki TOC (#24137) 2023-04-17 15:05:19 -04:00
goldmark.go Don't use <br /> in alert block (#29650) 2024-03-08 09:30:41 +00:00
markdown_test.go Refactor some Str2html code (#29397) 2024-03-01 07:11:51 +00:00
markdown.go Refactor some Str2html code (#29397) 2024-03-01 07:11:51 +00:00
meta_test.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
meta.go Replace interface{} with any (#25686) 2023-07-04 18:36:08 +00:00
renderconfig_test.go Improve Wiki TOC (#24137) 2023-04-17 15:05:19 -04:00
renderconfig.go Fix task list checkbox toggle to work with YAML front matter (#25184) 2023-06-13 14:44:47 +08:00
toc.go Refactor locale&string&template related code (#29165) 2024-02-14 21:48:45 +00:00