FEATURE: keep formatting when quoting
This commit is contained in:
parent
bb377e2021
commit
71f5215711
|
@ -9,6 +9,8 @@
|
|||
//= require ./deprecated
|
||||
|
||||
// Stuff we need to load first
|
||||
//= require ./discourse/helpers/parse-html
|
||||
//= require ./discourse/lib/to-markdown
|
||||
//= require ./discourse/lib/utilities
|
||||
//= require ./discourse/lib/page-visible
|
||||
//= require ./discourse/lib/logout
|
||||
|
|
|
@ -131,7 +131,6 @@ export default Ember.Controller.extend(BufferedContent, {
|
|||
return this.get('model.postStream').loadPost(postId).then(post => {
|
||||
const composer = this.get('composer');
|
||||
const viewOpen = composer.get('model.viewOpen');
|
||||
|
||||
const quotedText = Quote.build(post, buffer);
|
||||
|
||||
// If we can't create a post, delegate to reply as new topic
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import { escape } from 'pretty-text/sanitizer';
|
||||
import toMarkdown from 'discourse/lib/to-markdown';
|
||||
|
||||
const homepageSelector = 'meta[name=discourse_current_homepage]';
|
||||
|
||||
|
@ -113,12 +114,8 @@ export function selectedText() {
|
|||
$div.find(".clicks").remove();
|
||||
// replace emojis
|
||||
$div.find("img.emoji").replaceWith(function() { return this.title; });
|
||||
// replace br with newlines
|
||||
$div.find("br").replaceWith(() => "\n");
|
||||
// enforce newline at the end of paragraphs
|
||||
$div.find("p").append(() => "\n");
|
||||
|
||||
return String($div.text()).trim().replace(/(^\s*\n)+/gm, "\n");
|
||||
return toMarkdown($div.html());
|
||||
}
|
||||
|
||||
// Determine the row and col of the caret in an element
|
||||
|
|
Loading…
Reference in New Issue