1
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-09-01 14:56:30 +00:00
gitea/modules/markup
Giteabot f8a40dafb9
Allow <video> in MarkDown () ()
Backport 

As you can imagine, for the Blender development process it is rather
nice to be able to include videos in issues, pull requests, etc.

This PR allows the `<video>` HTML tag to be used in MarkDown, with the
`src`, `autoplay`, and `controls` attributes.

## Help Needed

To have this fully functional, personally I feel the following things
are still missing, and would appreciate some help from the Gitea team.

### Styling

Some CSS is needed, but I couldn't figure out which of the LESS files
would work. I tried `web_src/less/markup/content.less` and
`web_src/less/_base.less`, but after running `make` the changes weren't
seen in the frontend.

This I would consider a minimal set of CSS rules to be applied:

```css
video {
  max-width: 100%;
  max-height: 100vh;
}
```

### Default Attributes

It would be fantastic if Gitea could add some default attributes to the
`<video>` tag. Basically `controls` should always be there, as there is
no point in disallowing scrolling through videos, looping them, etc.

### Integration with the attachments system

Another thing that could be added, but probably should be done in a
separate PR, is the integration with the attachments system. Dragging in
a video should attach it, then generate the appropriate MarkDown/HTML.

Co-authored-by: Sybren <122987084+drsybren@users.noreply.github.com>
2023-03-02 11:49:05 -05:00
..
asciicast Support asciicast files as new markup () 2023-01-18 08:46:58 +08:00
common Implement FSFE REUSE for golang files () 2022-11-27 18:20:29 +00:00
console Implement FSFE REUSE for golang files () 2022-11-27 18:20:29 +00:00
csv Implement FSFE REUSE for golang files () 2022-11-27 18:20:29 +00:00
external Log STDERR of external renderer when it fails () 2023-01-13 20:41:23 +00:00
markdown Refactor the setting to make unit test easier () 2023-02-20 00:12:01 +08:00
mdstripper Implement FSFE REUSE for golang files () 2022-11-27 18:20:29 +00:00
orgmode Implement FSFE REUSE for golang files () 2022-11-27 18:20:29 +00:00
camo_test.go Implement FSFE REUSE for golang files () 2022-11-27 18:20:29 +00:00
camo.go Implement FSFE REUSE for golang files () 2022-11-27 18:20:29 +00:00
html_internal_test.go Implement FSFE REUSE for golang files () 2022-11-27 18:20:29 +00:00
html_test.go Refactor the setting to make unit test easier () 2023-02-20 00:12:01 +08:00
html.go Fix README TOC links () 2023-01-31 13:21:29 +08:00
renderer_test.go Move IsReadmeFile* from modules/markup/ to modules/util () 2023-02-13 15:01:09 -05:00
renderer.go Move IsReadmeFile* from modules/markup/ to modules/util () 2023-02-13 15:01:09 -05:00
sanitizer_test.go Implement FSFE REUSE for golang files () 2022-11-27 18:20:29 +00:00
sanitizer.go Allow <video> in MarkDown () () 2023-03-02 11:49:05 -05:00