mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 01:47:22 +08:00
Skip markdown table conversion from rich text feature flag setting
This commit is contained in:
parent
b9c0488687
commit
fdef4e58f0
|
@ -436,13 +436,13 @@ export default Ember.Component.extend({
|
|||
$element.on('fileuploadpaste', (e) => {
|
||||
this._pasted = true;
|
||||
|
||||
if (!this.siteSettings.enable_rich_text_paste || !$(".d-editor-input").is(":focus")) {
|
||||
if (!$(".d-editor-input").is(":focus")) {
|
||||
return;
|
||||
}
|
||||
|
||||
const { types } = clipboardData(e);
|
||||
|
||||
if (types.includes("text/plain") || types.includes("text/html")) {
|
||||
if (types.includes("text/plain") || (types.includes("text/html") && this.siteSettings.enable_rich_text_paste)) {
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -640,7 +640,7 @@ export default Ember.Component.extend({
|
|||
},
|
||||
|
||||
paste(e) {
|
||||
if (!this.siteSettings.enable_rich_text_paste || !$(".d-editor-input").is(":focus")) {
|
||||
if (!$(".d-editor-input").is(":focus")) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -658,9 +658,8 @@ export default Ember.Component.extend({
|
|||
}
|
||||
}
|
||||
|
||||
const placeholder = `${ plainText || I18n.t('pasting') }`;
|
||||
|
||||
if (html && !handled) {
|
||||
if (this.siteSettings.enable_rich_text_paste && html && !handled) {
|
||||
const placeholder = `${ plainText || I18n.t('pasting') }`;
|
||||
const self = this;
|
||||
|
||||
this.appEvents.trigger('composer:insert-text', placeholder);
|
||||
|
@ -683,7 +682,7 @@ export default Ember.Component.extend({
|
|||
});
|
||||
}
|
||||
|
||||
const uploadFiles = types.includes("Files") && !plainText && !html;
|
||||
const uploadFiles = types.includes("Files") && !plainText && !handled;
|
||||
|
||||
if (handled || uploadFiles) {
|
||||
e.preventDefault();
|
||||
|
|
|
@ -1088,7 +1088,7 @@ en:
|
|||
top_page_default_timeframe: "Default timeframe for the top view page."
|
||||
show_email_on_profile: "Show a user's email on their profile (only visible to themselves and staff)"
|
||||
prioritize_username_in_ux: "Show username first on user page, user card and posts (when disabled name is shown first)"
|
||||
enable_rich_text_paste: "Enable automatic HTML to Markdown conversion"
|
||||
enable_rich_text_paste: "Enable automatic HTML to Markdown conversion while pasting."
|
||||
|
||||
email_token_valid_hours: "Forgot password / activate account tokens are valid for (n) hours."
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user