Merge pull request 'Render inline file permalinks' (#2669) from Mai-Lapyst/forgejo:markup-add-filepreview into forgejo

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2669
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
This commit is contained in:
Earl Warren 2024-04-01 13:57:01 +00:00
commit 2e744dc991
25 changed files with 577 additions and 4 deletions

View file

@ -7,8 +7,8 @@ export function initUnicodeEscapeButton() {
e.preventDefault();
const fileContent = btn.closest('.file-content, .non-diff-file-content');
const fileView = fileContent?.querySelectorAll('.file-code, .file-view');
const fileContent = btn.closest('.file-content, .non-diff-file-content, .file-preview-box');
const fileView = fileContent?.querySelectorAll('.file-code, .file-view, .file-preview');
if (btn.matches('.escape-button')) {
for (const el of fileView) el.classList.add('unicode-escaped');
hideElem(btn);