mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-09 18:05:09 +00:00
Merge branch 'main' into instance-display
This commit is contained in:
commit
93ae484267
|
@ -1,4 +1,4 @@
|
||||||
pipeline:
|
steps:
|
||||||
fetch_git_submodules:
|
fetch_git_submodules:
|
||||||
image: node:alpine
|
image: node:alpine
|
||||||
commands:
|
commands:
|
||||||
|
@ -43,3 +43,19 @@ pipeline:
|
||||||
tag: dev
|
tag: dev
|
||||||
when:
|
when:
|
||||||
event: cron
|
event: cron
|
||||||
|
|
||||||
|
notify_on_failure:
|
||||||
|
image: alpine:3
|
||||||
|
commands:
|
||||||
|
- apk add curl
|
||||||
|
- "curl -d'Lemmy-UI CI build failed: ${CI_PIPELINE_URL}' ntfy.sh/lemmy_drone_ci"
|
||||||
|
when:
|
||||||
|
status: [failure]
|
||||||
|
|
||||||
|
notify_on_tag_deploy:
|
||||||
|
image: alpine:3
|
||||||
|
commands:
|
||||||
|
- apk add curl
|
||||||
|
- "curl -d'lemmy-ui:${CI_COMMIT_TAG} deployed' ntfy.sh/lemmy_drone_ci"
|
||||||
|
when:
|
||||||
|
event: tag
|
||||||
|
|
|
@ -363,7 +363,7 @@ export class MarkdownTextArea extends Component<
|
||||||
if (value === null) {
|
if (value === null) {
|
||||||
const emoji = customEmojisLookup.get(e.id)?.custom_emoji;
|
const emoji = customEmojisLookup.get(e.id)?.custom_emoji;
|
||||||
if (emoji) {
|
if (emoji) {
|
||||||
value = `![${emoji.alt_text}](${emoji.image_url} "${emoji.shortcode}")`;
|
value = `![${emoji.alt_text}](${emoji.image_url} "emoji ${emoji.shortcode}")`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
i.setState({
|
i.setState({
|
||||||
|
|
|
@ -195,11 +195,22 @@ export function setupMarkdown() {
|
||||||
) {
|
) {
|
||||||
//Provide custom renderer for our emojis to allow us to add a css class and force size dimensions on them.
|
//Provide custom renderer for our emojis to allow us to add a css class and force size dimensions on them.
|
||||||
const item = tokens[idx] as any;
|
const item = tokens[idx] as any;
|
||||||
const title = item.attrs.length >= 3 ? item.attrs[2][1] : "";
|
let title = item.attrs.length >= 3 ? item.attrs[2][1] : "";
|
||||||
|
const splitTitle = title.split(/ (.*)/, 2);
|
||||||
|
const isEmoji = splitTitle[0] === "emoji";
|
||||||
|
if (isEmoji) {
|
||||||
|
title = splitTitle[1];
|
||||||
|
}
|
||||||
const customEmoji = customEmojisLookup.get(title);
|
const customEmoji = customEmojisLookup.get(title);
|
||||||
const isCustomEmoji = customEmoji !== undefined;
|
const isLocalEmoji = customEmoji !== undefined;
|
||||||
if (!isCustomEmoji) {
|
if (!isLocalEmoji) {
|
||||||
return defaultRenderer?.(tokens, idx, options, env, self) ?? "";
|
const imgElement =
|
||||||
|
defaultRenderer?.(tokens, idx, options, env, self) ?? "";
|
||||||
|
if (imgElement) {
|
||||||
|
return `<span class='${
|
||||||
|
isEmoji ? "icon icon-emoji" : ""
|
||||||
|
}'>${imgElement}</span>`;
|
||||||
|
} else return "";
|
||||||
}
|
}
|
||||||
return `<img class="icon icon-emoji" src="${
|
return `<img class="icon icon-emoji" src="${
|
||||||
customEmoji!.custom_emoji.image_url
|
customEmoji!.custom_emoji.image_url
|
||||||
|
@ -318,7 +329,7 @@ export function setupTribute() {
|
||||||
?.custom_emoji;
|
?.custom_emoji;
|
||||||
if (customEmoji === undefined) return `${item.original.val}`;
|
if (customEmoji === undefined) return `${item.original.val}`;
|
||||||
else
|
else
|
||||||
return `![${customEmoji.alt_text}](${customEmoji.image_url} "${customEmoji.shortcode}")`;
|
return `![${customEmoji.alt_text}](${customEmoji.image_url} "emoji ${customEmoji.shortcode}")`;
|
||||||
},
|
},
|
||||||
values: Object.entries(emojiShortName)
|
values: Object.entries(emojiShortName)
|
||||||
.map(e => {
|
.map(e => {
|
||||||
|
|
Loading…
Reference in a new issue