DEV: `IMAGE_MARKDOWN_REGEX` import available in core (#847)

This commit is contained in:
Keegan George 2024-10-22 06:48:10 +09:00 committed by GitHub
parent 3533814870
commit 712a07c39b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 7 additions and 7 deletions

View File

@ -1,4 +1,4 @@
< 3.4.0.beta3-dev: ecf1bb49d737ea15308400f22f89d1d1e71d13d
< 3.4.0.beta3-dev: decf1bb49d737ea15308400f22f89d1d1e71d13d
< 3.4.0.beta1-dev: 9d887ad4ace8e33c3fe7dbb39237e882c08b4f0b
< 3.3.0.beta5-dev: 4d8090002f6dcd8e34d41033606bf131fa221475
< 3.3.0.beta2-dev: 61890b667c06299841ae88946f84a112f00060e1

View File

@ -1,9 +1,6 @@
import { htmlSafe } from "@ember/template";
import { escapeExpression } from "discourse/lib/utilities";
export const IMAGE_MARKDOWN_REGEX =
/!\[(.*?)\|(\d{1,4}x\d{1,4})(,\s*\d{1,3}%)?(.*?)\]\((upload:\/\/.*?)\)(?!(.*`))/g;
export function jsonToHtml(json) {
if (json === null) {
return "null";

View File

@ -1,6 +1,6 @@
import { tracked } from "@glimmer/tracking";
import Service, { inject as service } from "@ember/service";
import { IMAGE_MARKDOWN_REGEX } from "../lib/utilities";
import { IMAGE_MARKDOWN_REGEX } from "discourse/lib/uploads";
export default class ImageCaptionPopup extends Service {
@service composer;

View File

@ -1,9 +1,12 @@
import { ajax } from "discourse/lib/ajax";
import { extractError, popupAjaxError } from "discourse/lib/ajax-error";
import { apiInitializer } from "discourse/lib/api";
import { getUploadMarkdown, isImage } from "discourse/lib/uploads";
import {
getUploadMarkdown,
IMAGE_MARKDOWN_REGEX,
isImage,
} from "discourse/lib/uploads";
import I18n from "discourse-i18n";
import { IMAGE_MARKDOWN_REGEX } from "../discourse/lib/utilities";
export default apiInitializer("1.25.0", (api) => {
const buttonAttrs = {