forgejo/modules/markup
Yarden Shoham 20446ac6b3
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.

![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)

![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-23 12:18:40 +01:00
..
asciicast Support asciicast files as new markup (#22448) 2023-01-18 08:46:58 +08:00
common [GITEA] test markdown CleanValue to prevent regression 2024-02-05 16:09:41 +01:00
console Add context when rendering labels or emojis (#23281) 2023-03-05 22:59:05 +01:00
csv Refactor markup/csv: don't read all to memory (#29760) 2024-03-20 08:46:29 +01:00
external Rework markup link rendering (#26745) 2024-01-15 08:49:24 +00:00
markdown Don't use <br /> in alert block (#29650) 2024-03-23 12:18:40 +01:00
mdstripper Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
orgmode [BUG] Fix relative links on orgmode 2024-02-18 21:09:35 +01:00
camo.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
camo_test.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
html.go Use relative links for commits, mentions, and issues in markdown (#29427) 2024-03-20 08:46:28 +01:00
html_internal_test.go Use relative links for commits, mentions, and issues in markdown (#29427) 2024-03-20 08:46:28 +01:00
html_test.go Use relative links for commits, mentions, and issues in markdown (#29427) 2024-03-20 08:46:28 +01:00
renderer.go Use relative links for commits, mentions, and issues in markdown (#29427) 2024-03-20 08:46:28 +01:00
renderer_test.go Move IsReadmeFile* from modules/markup/ to modules/util (#22877) 2023-02-13 15:01:09 -05:00
sanitizer.go Add alert blocks in markdown (#29121) 2024-02-17 18:04:55 +01:00
sanitizer_test.go Use restricted sanitizer for repository description (#28141) 2023-11-23 16:34:25 +00:00